croco-html 2.15.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/add-files-btn/add-files-btn.component.mjs +4 -3
- package/esm2022/lib/components/editor/image-editor/image-editor.component.mjs +44 -8
- package/esm2022/lib/components/editor/visual-editor/visual-editor.component.mjs +4 -1
- package/esm2022/lib/components/file-id-select/file-id-select.component.mjs +3 -3
- package/esm2022/lib/components/xml-tags/file-image-tag-view/file-image-tag-view.component.mjs +3 -3
- package/esm2022/lib/extensions/BodyTagsExtensions.mjs +9 -5
- package/esm2022/lib/extensions/HtmlRawTagDataConsts.mjs +4 -1
- package/esm2022/lib/extensions/ImageMethods.mjs +41 -1
- package/esm2022/lib/services/screen-width.service.mjs +24 -0
- package/fesm2022/croco-html.mjs +278 -177
- package/fesm2022/croco-html.mjs.map +1 -1
- package/lib/components/editor/image-editor/image-editor.component.d.ts +13 -3
- package/lib/extensions/HtmlRawTagDataConsts.d.ts +3 -0
- package/lib/extensions/ImageMethods.d.ts +13 -0
- package/lib/index.d.ts +6 -6
- package/lib/services/screen-width.service.d.ts +10 -0
- package/package.json +1 -1
package/fesm2022/croco-html.mjs
CHANGED
|
@@ -22,7 +22,11 @@ import { NgSelectModule } from '@ng-select/ng-select';
|
|
|
22
22
|
import * as i29 from '@angular/material/button-toggle';
|
|
23
23
|
import { MatButtonToggleGroup, MatButtonToggle, MatButtonToggleModule } from '@angular/material/button-toggle';
|
|
24
24
|
import * as i28 from '@angular/cdk/drag-drop';
|
|
25
|
-
import { moveItemInArray, CdkDropList, CdkDrag,
|
|
25
|
+
import { CdkDragHandle, moveItemInArray, CdkDropList, CdkDrag, DragDropModule } from '@angular/cdk/drag-drop';
|
|
26
|
+
import { NgStyle, CommonModule } from '@angular/common';
|
|
27
|
+
import * as i22 from '@angular/material/slide-toggle';
|
|
28
|
+
import { MatSlideToggle, MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
29
|
+
import { BehaviorSubject, Subject, takeUntil } from 'rxjs';
|
|
26
30
|
import * as i24 from '@angular/material/core';
|
|
27
31
|
import { MatOption, MatNativeDateModule } from '@angular/material/core';
|
|
28
32
|
import * as i11 from '@angular/material/select';
|
|
@@ -34,7 +38,6 @@ import { MatTabGroup, MatTab, MatTabsModule } from '@angular/material/tabs';
|
|
|
34
38
|
import * as i1$5 from 'ngx-clipboard';
|
|
35
39
|
import * as i2$3 from '@angular/material/snack-bar';
|
|
36
40
|
import { MatSnackBarModule } from '@angular/material/snack-bar';
|
|
37
|
-
import { CommonModule } from '@angular/common';
|
|
38
41
|
import * as i12 from '@angular/material/tooltip';
|
|
39
42
|
import { MatTooltipModule } from '@angular/material/tooltip';
|
|
40
43
|
import * as i13 from '@angular/material/checkbox';
|
|
@@ -61,173 +64,11 @@ import * as i6 from '@angular/material/progress-bar';
|
|
|
61
64
|
import { MatProgressBarModule } from '@angular/material/progress-bar';
|
|
62
65
|
import * as i26 from '@angular/material/sidenav';
|
|
63
66
|
import { MatSidenavModule } from '@angular/material/sidenav';
|
|
64
|
-
import * as i22 from '@angular/material/slide-toggle';
|
|
65
|
-
import { MatSlideToggleModule } from '@angular/material/slide-toggle';
|
|
66
67
|
import * as i23 from '@angular/material/tree';
|
|
67
68
|
import { MatTreeModule } from '@angular/material/tree';
|
|
68
69
|
import * as i1$6 from '@angular/material/badge';
|
|
69
70
|
import { MatBadgeModule } from '@angular/material/badge';
|
|
70
71
|
|
|
71
|
-
class FileImageTagDataConsts {
|
|
72
|
-
static { this.TagName = "file-image"; }
|
|
73
|
-
static { this.FileIdAttrName = "file-id"; }
|
|
74
|
-
}
|
|
75
|
-
class ImageMethods {
|
|
76
|
-
static buildUrl(fileId, sizeType, options) {
|
|
77
|
-
if (fileId === null || fileId === undefined) {
|
|
78
|
-
return null;
|
|
79
|
-
}
|
|
80
|
-
return options.publicImageResizedUrlFormat
|
|
81
|
-
.replace("{sizeType}", sizeType)
|
|
82
|
-
.replace("{fileId}", fileId.toString());
|
|
83
|
-
}
|
|
84
|
-
static buildSmallUrl(fileId, options) {
|
|
85
|
-
return ImageMethods.buildUrl(fileId, "Small", options);
|
|
86
|
-
}
|
|
87
|
-
static buildMediumUrl(fileId, options) {
|
|
88
|
-
return ImageMethods.buildUrl(fileId, "Medium", options);
|
|
89
|
-
}
|
|
90
|
-
static ExtractImage(elem, options) {
|
|
91
|
-
let fileId = +elem.getAttribute(FileImageTagDataConsts.FileIdAttrName);
|
|
92
|
-
let src = ImageMethods.buildMediumUrl(fileId, options);
|
|
93
|
-
return {
|
|
94
|
-
type: FileImageTagDataConsts.TagName,
|
|
95
|
-
data: {
|
|
96
|
-
src,
|
|
97
|
-
fileId: fileId,
|
|
98
|
-
}
|
|
99
|
-
};
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
class FileUploadService {
|
|
104
|
-
constructor(_httpClient, baseUrl) {
|
|
105
|
-
this._httpClient = _httpClient;
|
|
106
|
-
this.baseUrl = baseUrl;
|
|
107
|
-
}
|
|
108
|
-
postFiles(files, createLocalCopiesNow = false) {
|
|
109
|
-
const formData = new FormData();
|
|
110
|
-
for (let i = 0; i < files.length; i++) {
|
|
111
|
-
var fileToUpload = files.item(i);
|
|
112
|
-
formData.append(`fileKey${i}`, fileToUpload, fileToUpload?.name);
|
|
113
|
-
}
|
|
114
|
-
return this.postFilesInner(formData, createLocalCopiesNow);
|
|
115
|
-
}
|
|
116
|
-
postFilesInner(formData, createLocalCopiesNow = false, withProgress = false) {
|
|
117
|
-
let endpoint = createLocalCopiesNow
|
|
118
|
-
? this.baseUrl + 'api/files/upload/now/with-handlers'
|
|
119
|
-
: this.baseUrl + 'Api/Files/UploadFiles';
|
|
120
|
-
return this._httpClient.post(endpoint, formData, withProgress ? { reportProgress: true, observe: 'events' } : undefined);
|
|
121
|
-
}
|
|
122
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FileUploadService, deps: [{ token: i1.HttpClient }, { token: 'BASE_URL' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
123
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FileUploadService, providedIn: 'root' }); }
|
|
124
|
-
}
|
|
125
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FileUploadService, decorators: [{
|
|
126
|
-
type: Injectable,
|
|
127
|
-
args: [{ providedIn: 'root' }]
|
|
128
|
-
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
129
|
-
type: Inject,
|
|
130
|
-
args: ['BASE_URL']
|
|
131
|
-
}] }] });
|
|
132
|
-
|
|
133
|
-
class UploadFilesBtnComponent {
|
|
134
|
-
constructor(_fileUploadService) {
|
|
135
|
-
this._fileUploadService = _fileUploadService;
|
|
136
|
-
this.extAccepts = "*/*";
|
|
137
|
-
this.isMultiple = true;
|
|
138
|
-
this.btnText = "Загрузить файлы";
|
|
139
|
-
this.createLocalCopiesNow = true;
|
|
140
|
-
this.hidden = false;
|
|
141
|
-
this.postFilesStarted = new EventEmitter();
|
|
142
|
-
this.onFilesUploaded = new EventEmitter();
|
|
143
|
-
}
|
|
144
|
-
handleFileInput(files) {
|
|
145
|
-
this.postFilesStarted.emit({
|
|
146
|
-
filesCount: files.length,
|
|
147
|
-
createLocalCopiesNow: this.createLocalCopiesNow
|
|
148
|
-
});
|
|
149
|
-
this._fileUploadService.postFiles(files, this.createLocalCopiesNow).subscribe(data => {
|
|
150
|
-
this.onFilesUploaded.emit(data);
|
|
151
|
-
});
|
|
152
|
-
}
|
|
153
|
-
clickFileInput() {
|
|
154
|
-
this.fileInput.nativeElement.click();
|
|
155
|
-
}
|
|
156
|
-
ngOnInit() {
|
|
157
|
-
}
|
|
158
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: UploadFilesBtnComponent, deps: [{ token: FileUploadService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
159
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: UploadFilesBtnComponent, isStandalone: true, selector: "croco-app-upload-files-btn", inputs: { extAccepts: "extAccepts", isMultiple: "isMultiple", btnText: "btnText", createLocalCopiesNow: "createLocalCopiesNow", hidden: "hidden" }, outputs: { postFilesStarted: "postFilesStarted", onFilesUploaded: "onFilesUploaded" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["filesInput"], descendants: true }], ngImport: i0, template: "<button [hidden]=\"hidden\" mat-raised-button color=\"primary\" (click)=\"filesInput.click()\">{{btnText}}</button>\n<input [hidden]=\"true\" [accept]=\"extAccepts\" [multiple]=\"isMultiple\" type=\"file\" #filesInput (change)=\"handleFileInput($event.target.files)\" />", styles: [""], dependencies: [{ kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] }); }
|
|
160
|
-
}
|
|
161
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: UploadFilesBtnComponent, decorators: [{
|
|
162
|
-
type: Component,
|
|
163
|
-
args: [{ selector: 'croco-app-upload-files-btn', standalone: true, imports: [MatButton], 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)\" />" }]
|
|
164
|
-
}], ctorParameters: () => [{ type: FileUploadService }], propDecorators: { fileInput: [{
|
|
165
|
-
type: ViewChild,
|
|
166
|
-
args: ['filesInput']
|
|
167
|
-
}], extAccepts: [{
|
|
168
|
-
type: Input
|
|
169
|
-
}], isMultiple: [{
|
|
170
|
-
type: Input
|
|
171
|
-
}], btnText: [{
|
|
172
|
-
type: Input
|
|
173
|
-
}], createLocalCopiesNow: [{
|
|
174
|
-
type: Input
|
|
175
|
-
}], hidden: [{
|
|
176
|
-
type: Input
|
|
177
|
-
}], postFilesStarted: [{
|
|
178
|
-
type: Output
|
|
179
|
-
}], onFilesUploaded: [{
|
|
180
|
-
type: Output
|
|
181
|
-
}] } });
|
|
182
|
-
|
|
183
|
-
class AddFilesBtnComponent {
|
|
184
|
-
constructor() {
|
|
185
|
-
this.postFilesStarted = new EventEmitter();
|
|
186
|
-
this.fileIds = [];
|
|
187
|
-
this.filesTagsReady = new EventEmitter();
|
|
188
|
-
}
|
|
189
|
-
postFilesStartedEventHandler(data) {
|
|
190
|
-
this.postFilesStarted.emit(data);
|
|
191
|
-
}
|
|
192
|
-
filesUploadedHandler(data) {
|
|
193
|
-
this.fileIds = data.responseObject;
|
|
194
|
-
let fileTags = [];
|
|
195
|
-
for (let i = 0; i < this.fileIds.length; i++) {
|
|
196
|
-
let fileTag = {
|
|
197
|
-
presentOrEdit: true,
|
|
198
|
-
tagDescription: {
|
|
199
|
-
tag: FileImageTagDataConsts.TagName,
|
|
200
|
-
displayValue: "Изображение"
|
|
201
|
-
},
|
|
202
|
-
attributes: {
|
|
203
|
-
[FileImageTagDataConsts.FileIdAttrName]: this.fileIds[i]
|
|
204
|
-
},
|
|
205
|
-
innerHtml: ""
|
|
206
|
-
};
|
|
207
|
-
fileTags.push(fileTag);
|
|
208
|
-
}
|
|
209
|
-
this.filesTagsReady.emit(fileTags);
|
|
210
|
-
}
|
|
211
|
-
handleClick() {
|
|
212
|
-
this.fakeBtn.clickFileInput();
|
|
213
|
-
}
|
|
214
|
-
ngOnInit() {
|
|
215
|
-
}
|
|
216
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AddFilesBtnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
217
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: AddFilesBtnComponent, isStandalone: true, selector: "croco-html-add-files-btn", outputs: { postFilesStarted: "postFilesStarted", filesTagsReady: "filesTagsReady" }, viewQueries: [{ propertyName: "fakeBtn", first: true, predicate: ["fakeBtn"], descendants: true }], ngImport: i0, template: "<div [hidden]=\"true\">\n <croco-app-upload-files-btn #fakeBtn (onFilesUploaded)=\"filesUploadedHandler($event)\"\n [btnText]=\"'\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F'\" [createLocalCopiesNow]=\"true\"\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\" [extAccepts]=\"'image/*'\"></croco-app-upload-files-btn>\n</div>\n\n<div>\n <button class=\"w-100\" (click)=\"handleClick()\" 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: [""], dependencies: [{ kind: "component", type: UploadFilesBtnComponent, selector: "croco-app-upload-files-btn", inputs: ["extAccepts", "isMultiple", "btnText", "createLocalCopiesNow", "hidden"], outputs: ["postFilesStarted", "onFilesUploaded"] }, { kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] }); }
|
|
218
|
-
}
|
|
219
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AddFilesBtnComponent, decorators: [{
|
|
220
|
-
type: Component,
|
|
221
|
-
args: [{ selector: 'croco-html-add-files-btn', standalone: true, imports: [UploadFilesBtnComponent, MatButton], template: "<div [hidden]=\"true\">\n <croco-app-upload-files-btn #fakeBtn (onFilesUploaded)=\"filesUploadedHandler($event)\"\n [btnText]=\"'\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F'\" [createLocalCopiesNow]=\"true\"\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\" [extAccepts]=\"'image/*'\"></croco-app-upload-files-btn>\n</div>\n\n<div>\n <button class=\"w-100\" (click)=\"handleClick()\" 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>" }]
|
|
222
|
-
}], ctorParameters: () => [], propDecorators: { postFilesStarted: [{
|
|
223
|
-
type: Output
|
|
224
|
-
}], fakeBtn: [{
|
|
225
|
-
type: ViewChild,
|
|
226
|
-
args: ["fakeBtn"]
|
|
227
|
-
}], filesTagsReady: [{
|
|
228
|
-
type: Output
|
|
229
|
-
}] } });
|
|
230
|
-
|
|
231
72
|
class AngularMaterialTableMethods {
|
|
232
73
|
static getAngularMaterialTableData(columns, rows) {
|
|
233
74
|
let data = [];
|
|
@@ -292,6 +133,78 @@ class AngularMaterialTableMethods {
|
|
|
292
133
|
}
|
|
293
134
|
}
|
|
294
135
|
|
|
136
|
+
class FileImageTagDataConsts {
|
|
137
|
+
static { this.TagName = "file-image"; }
|
|
138
|
+
static { this.FileIdAttrName = "file-id"; }
|
|
139
|
+
static { this.ScreenMediaRequest = "screen-media-request"; }
|
|
140
|
+
static { this.DefaultValueForFileImage = "screen-width:1200,max-image-height:300;screen-width:900,max-image-height:200"; }
|
|
141
|
+
static { this.ScreenWidth = 'screen-width'; }
|
|
142
|
+
static { this.MaxImageHeight = 'max-image-height'; }
|
|
143
|
+
}
|
|
144
|
+
class ImageMethods {
|
|
145
|
+
static buildUrl(fileId, sizeType, options) {
|
|
146
|
+
if (fileId === null || fileId === undefined) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
return options.publicImageResizedUrlFormat
|
|
150
|
+
.replace("{sizeType}", sizeType)
|
|
151
|
+
.replace("{fileId}", fileId.toString());
|
|
152
|
+
}
|
|
153
|
+
static buildSmallUrl(fileId, options) {
|
|
154
|
+
return ImageMethods.buildUrl(fileId, "Small", options);
|
|
155
|
+
}
|
|
156
|
+
static buildMediumUrl(fileId, options) {
|
|
157
|
+
return ImageMethods.buildUrl(fileId, "Medium", options);
|
|
158
|
+
}
|
|
159
|
+
static ExtractImage(elem, options) {
|
|
160
|
+
let fileId = +elem.getAttribute(FileImageTagDataConsts.FileIdAttrName);
|
|
161
|
+
let src = ImageMethods.buildMediumUrl(fileId, options);
|
|
162
|
+
return {
|
|
163
|
+
type: FileImageTagDataConsts.TagName,
|
|
164
|
+
data: {
|
|
165
|
+
src,
|
|
166
|
+
fileId: fileId,
|
|
167
|
+
screenMediaRequest: elem.getAttribute(FileImageTagDataConsts.ScreenMediaRequest)
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
static { this.mediaRequestStringToArrayParser = (data) => {
|
|
172
|
+
if (!data) {
|
|
173
|
+
return [];
|
|
174
|
+
}
|
|
175
|
+
if (!data.length) {
|
|
176
|
+
return [];
|
|
177
|
+
}
|
|
178
|
+
return data.split(';').reduce((requests, currentValue) => {
|
|
179
|
+
requests.push({
|
|
180
|
+
screenWidth: ImageMethods.createMediaRequestValue(currentValue.split(','), FileImageTagDataConsts.ScreenWidth),
|
|
181
|
+
maxImageHeight: ImageMethods.createMediaRequestValue(currentValue.split(','), FileImageTagDataConsts.MaxImageHeight),
|
|
182
|
+
});
|
|
183
|
+
return requests;
|
|
184
|
+
}, []);
|
|
185
|
+
}; }
|
|
186
|
+
static createMediaRequestValue(arr, attribute) {
|
|
187
|
+
return +arr.find(el => el.includes(attribute)).match(/\d+/g).join('');
|
|
188
|
+
}
|
|
189
|
+
static { this.mediaRequestsArrayToStringParser = (data) => {
|
|
190
|
+
if (!data.length) {
|
|
191
|
+
return '';
|
|
192
|
+
}
|
|
193
|
+
return data.map(el => `${FileImageTagDataConsts.ScreenWidth}:${el.screenWidth},${FileImageTagDataConsts.MaxImageHeight}:${el.maxImageHeight}`).join(';');
|
|
194
|
+
}; }
|
|
195
|
+
static { this.screenSizeChanged = (screenSize, requests) => {
|
|
196
|
+
let newSize = null;
|
|
197
|
+
requests
|
|
198
|
+
.sort((a, b) => a.screenWidth > b.screenWidth ? -1 : 1)
|
|
199
|
+
.forEach((el, index) => {
|
|
200
|
+
if (screenSize < +el.screenWidth) {
|
|
201
|
+
newSize = el.maxImageHeight;
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
return newSize;
|
|
205
|
+
}; }
|
|
206
|
+
}
|
|
207
|
+
|
|
295
208
|
var EAlignments;
|
|
296
209
|
(function (EAlignments) {
|
|
297
210
|
EAlignments["Left"] = "left";
|
|
@@ -698,6 +611,9 @@ class HtmlExtractionMethods {
|
|
|
698
611
|
|
|
699
612
|
class HtmlRawTagDataConsts {
|
|
700
613
|
static { this.TagName = "html-raw"; }
|
|
614
|
+
static { this.ScreenWidth = "screen-width"; }
|
|
615
|
+
static { this.MaxImageHeight = "max-image-height"; }
|
|
616
|
+
static { this.MediaRequest = " media-request"; }
|
|
701
617
|
}
|
|
702
618
|
|
|
703
619
|
class Tags {
|
|
@@ -757,12 +673,13 @@ class BodyTagsExtensions {
|
|
|
757
673
|
return result;
|
|
758
674
|
}
|
|
759
675
|
static imageTagToHtml(imageTag) {
|
|
760
|
-
|
|
761
|
-
|
|
676
|
+
let fileIdAttr = "";
|
|
677
|
+
let screenMediaRequestAttr = "";
|
|
678
|
+
let attrValue = imageTag.attributes[FileImageTagDataConsts.FileIdAttrName];
|
|
762
679
|
if (imageTag.attributes.hasOwnProperty(FileImageTagDataConsts.FileIdAttrName) && attrValue) {
|
|
763
|
-
|
|
680
|
+
fileIdAttr = `${FileImageTagDataConsts.FileIdAttrName}="${attrValue}"`;
|
|
764
681
|
}
|
|
765
|
-
return `<${FileImageTagDataConsts.TagName} ${
|
|
682
|
+
return `<${FileImageTagDataConsts.TagName} ${fileIdAttr} ${FileImageTagDataConsts.ScreenMediaRequest}="${imageTag.attributes[FileImageTagDataConsts.ScreenMediaRequest]}"></${FileImageTagDataConsts.TagName}>`;
|
|
766
683
|
}
|
|
767
684
|
static getBodyTags(html, options) {
|
|
768
685
|
let result = HtmlExtractionMethods.transformHtmlStringToBlocks(html, options);
|
|
@@ -790,6 +707,9 @@ class BodyTagsExtensions {
|
|
|
790
707
|
if (fileData.fileId) {
|
|
791
708
|
attrs[FileImageTagDataConsts.FileIdAttrName] = fileData.fileId;
|
|
792
709
|
}
|
|
710
|
+
if (fileData.screenMediaRequest) {
|
|
711
|
+
attrs[FileImageTagDataConsts.ScreenMediaRequest] = fileData.screenMediaRequest;
|
|
712
|
+
}
|
|
793
713
|
return {
|
|
794
714
|
presentOrEdit: true,
|
|
795
715
|
tagDescription: {
|
|
@@ -895,6 +815,135 @@ class TableBuilder {
|
|
|
895
815
|
}
|
|
896
816
|
}
|
|
897
817
|
|
|
818
|
+
class FileUploadService {
|
|
819
|
+
constructor(_httpClient, baseUrl) {
|
|
820
|
+
this._httpClient = _httpClient;
|
|
821
|
+
this.baseUrl = baseUrl;
|
|
822
|
+
}
|
|
823
|
+
postFiles(files, createLocalCopiesNow = false) {
|
|
824
|
+
const formData = new FormData();
|
|
825
|
+
for (let i = 0; i < files.length; i++) {
|
|
826
|
+
var fileToUpload = files.item(i);
|
|
827
|
+
formData.append(`fileKey${i}`, fileToUpload, fileToUpload?.name);
|
|
828
|
+
}
|
|
829
|
+
return this.postFilesInner(formData, createLocalCopiesNow);
|
|
830
|
+
}
|
|
831
|
+
postFilesInner(formData, createLocalCopiesNow = false, withProgress = false) {
|
|
832
|
+
let endpoint = createLocalCopiesNow
|
|
833
|
+
? this.baseUrl + 'api/files/upload/now/with-handlers'
|
|
834
|
+
: this.baseUrl + 'Api/Files/UploadFiles';
|
|
835
|
+
return this._httpClient.post(endpoint, formData, withProgress ? { reportProgress: true, observe: 'events' } : undefined);
|
|
836
|
+
}
|
|
837
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FileUploadService, deps: [{ token: i1.HttpClient }, { token: 'BASE_URL' }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
838
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FileUploadService, providedIn: 'root' }); }
|
|
839
|
+
}
|
|
840
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FileUploadService, decorators: [{
|
|
841
|
+
type: Injectable,
|
|
842
|
+
args: [{ providedIn: 'root' }]
|
|
843
|
+
}], ctorParameters: () => [{ type: i1.HttpClient }, { type: undefined, decorators: [{
|
|
844
|
+
type: Inject,
|
|
845
|
+
args: ['BASE_URL']
|
|
846
|
+
}] }] });
|
|
847
|
+
|
|
848
|
+
class UploadFilesBtnComponent {
|
|
849
|
+
constructor(_fileUploadService) {
|
|
850
|
+
this._fileUploadService = _fileUploadService;
|
|
851
|
+
this.extAccepts = "*/*";
|
|
852
|
+
this.isMultiple = true;
|
|
853
|
+
this.btnText = "Загрузить файлы";
|
|
854
|
+
this.createLocalCopiesNow = true;
|
|
855
|
+
this.hidden = false;
|
|
856
|
+
this.postFilesStarted = new EventEmitter();
|
|
857
|
+
this.onFilesUploaded = new EventEmitter();
|
|
858
|
+
}
|
|
859
|
+
handleFileInput(files) {
|
|
860
|
+
this.postFilesStarted.emit({
|
|
861
|
+
filesCount: files.length,
|
|
862
|
+
createLocalCopiesNow: this.createLocalCopiesNow
|
|
863
|
+
});
|
|
864
|
+
this._fileUploadService.postFiles(files, this.createLocalCopiesNow).subscribe(data => {
|
|
865
|
+
this.onFilesUploaded.emit(data);
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
clickFileInput() {
|
|
869
|
+
this.fileInput.nativeElement.click();
|
|
870
|
+
}
|
|
871
|
+
ngOnInit() {
|
|
872
|
+
}
|
|
873
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: UploadFilesBtnComponent, deps: [{ token: FileUploadService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
874
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: UploadFilesBtnComponent, isStandalone: true, selector: "croco-app-upload-files-btn", inputs: { extAccepts: "extAccepts", isMultiple: "isMultiple", btnText: "btnText", createLocalCopiesNow: "createLocalCopiesNow", hidden: "hidden" }, outputs: { postFilesStarted: "postFilesStarted", onFilesUploaded: "onFilesUploaded" }, viewQueries: [{ propertyName: "fileInput", first: true, predicate: ["filesInput"], descendants: true }], ngImport: i0, template: "<button [hidden]=\"hidden\" mat-raised-button color=\"primary\" (click)=\"filesInput.click()\">{{btnText}}</button>\n<input [hidden]=\"true\" [accept]=\"extAccepts\" [multiple]=\"isMultiple\" type=\"file\" #filesInput (change)=\"handleFileInput($event.target.files)\" />", styles: [""], dependencies: [{ kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] }); }
|
|
875
|
+
}
|
|
876
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: UploadFilesBtnComponent, decorators: [{
|
|
877
|
+
type: Component,
|
|
878
|
+
args: [{ selector: 'croco-app-upload-files-btn', standalone: true, imports: [MatButton], 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)\" />" }]
|
|
879
|
+
}], ctorParameters: () => [{ type: FileUploadService }], propDecorators: { fileInput: [{
|
|
880
|
+
type: ViewChild,
|
|
881
|
+
args: ['filesInput']
|
|
882
|
+
}], extAccepts: [{
|
|
883
|
+
type: Input
|
|
884
|
+
}], isMultiple: [{
|
|
885
|
+
type: Input
|
|
886
|
+
}], btnText: [{
|
|
887
|
+
type: Input
|
|
888
|
+
}], createLocalCopiesNow: [{
|
|
889
|
+
type: Input
|
|
890
|
+
}], hidden: [{
|
|
891
|
+
type: Input
|
|
892
|
+
}], postFilesStarted: [{
|
|
893
|
+
type: Output
|
|
894
|
+
}], onFilesUploaded: [{
|
|
895
|
+
type: Output
|
|
896
|
+
}] } });
|
|
897
|
+
|
|
898
|
+
class AddFilesBtnComponent {
|
|
899
|
+
constructor() {
|
|
900
|
+
this.postFilesStarted = new EventEmitter();
|
|
901
|
+
this.fileIds = [];
|
|
902
|
+
this.filesTagsReady = new EventEmitter();
|
|
903
|
+
}
|
|
904
|
+
postFilesStartedEventHandler(data) {
|
|
905
|
+
this.postFilesStarted.emit(data);
|
|
906
|
+
}
|
|
907
|
+
filesUploadedHandler(data) {
|
|
908
|
+
this.fileIds = data.responseObject;
|
|
909
|
+
let fileTags = [];
|
|
910
|
+
for (let i = 0; i < this.fileIds.length; i++) {
|
|
911
|
+
let fileTag = {
|
|
912
|
+
presentOrEdit: true,
|
|
913
|
+
tagDescription: {
|
|
914
|
+
tag: FileImageTagDataConsts.TagName,
|
|
915
|
+
displayValue: "Изображение"
|
|
916
|
+
},
|
|
917
|
+
attributes: {
|
|
918
|
+
[FileImageTagDataConsts.FileIdAttrName]: this.fileIds[i],
|
|
919
|
+
[FileImageTagDataConsts.ScreenMediaRequest]: FileImageTagDataConsts.DefaultValueForFileImage
|
|
920
|
+
},
|
|
921
|
+
innerHtml: ""
|
|
922
|
+
};
|
|
923
|
+
fileTags.push(fileTag);
|
|
924
|
+
}
|
|
925
|
+
this.filesTagsReady.emit(fileTags);
|
|
926
|
+
}
|
|
927
|
+
handleClick() {
|
|
928
|
+
this.fakeBtn.clickFileInput();
|
|
929
|
+
}
|
|
930
|
+
ngOnInit() {
|
|
931
|
+
}
|
|
932
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AddFilesBtnComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
933
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: AddFilesBtnComponent, isStandalone: true, selector: "croco-html-add-files-btn", outputs: { postFilesStarted: "postFilesStarted", filesTagsReady: "filesTagsReady" }, viewQueries: [{ propertyName: "fakeBtn", first: true, predicate: ["fakeBtn"], descendants: true }], ngImport: i0, template: "<div [hidden]=\"true\">\n <croco-app-upload-files-btn #fakeBtn (onFilesUploaded)=\"filesUploadedHandler($event)\"\n [btnText]=\"'\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F'\" [createLocalCopiesNow]=\"true\"\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\" [extAccepts]=\"'image/*'\"></croco-app-upload-files-btn>\n</div>\n\n<div>\n <button class=\"w-100\" (click)=\"handleClick()\" 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: [""], dependencies: [{ kind: "component", type: UploadFilesBtnComponent, selector: "croco-app-upload-files-btn", inputs: ["extAccepts", "isMultiple", "btnText", "createLocalCopiesNow", "hidden"], outputs: ["postFilesStarted", "onFilesUploaded"] }, { kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] }); }
|
|
934
|
+
}
|
|
935
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AddFilesBtnComponent, decorators: [{
|
|
936
|
+
type: Component,
|
|
937
|
+
args: [{ selector: 'croco-html-add-files-btn', standalone: true, imports: [UploadFilesBtnComponent, MatButton], template: "<div [hidden]=\"true\">\n <croco-app-upload-files-btn #fakeBtn (onFilesUploaded)=\"filesUploadedHandler($event)\"\n [btnText]=\"'\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C \u0438\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u044F'\" [createLocalCopiesNow]=\"true\"\n (postFilesStarted)=\"postFilesStartedEventHandler($event)\" [extAccepts]=\"'image/*'\"></croco-app-upload-files-btn>\n</div>\n\n<div>\n <button class=\"w-100\" (click)=\"handleClick()\" 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>" }]
|
|
938
|
+
}], ctorParameters: () => [], propDecorators: { postFilesStarted: [{
|
|
939
|
+
type: Output
|
|
940
|
+
}], fakeBtn: [{
|
|
941
|
+
type: ViewChild,
|
|
942
|
+
args: ["fakeBtn"]
|
|
943
|
+
}], filesTagsReady: [{
|
|
944
|
+
type: Output
|
|
945
|
+
}] } });
|
|
946
|
+
|
|
898
947
|
class YoutubeVideoPlayerComponent {
|
|
899
948
|
set link(link) {
|
|
900
949
|
this.safeUrl = this.sanitizer.bypassSecurityTrustResourceUrl(link);
|
|
@@ -1163,11 +1212,11 @@ class FileImageTagViewComponent {
|
|
|
1163
1212
|
this.imageSrc = data.src;
|
|
1164
1213
|
}
|
|
1165
1214
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FileImageTagViewComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1166
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: FileImageTagViewComponent, isStandalone: true, selector: "croco-html-file-image-tag-view", inputs: { item: "item" }, ngImport: i0, template: "
|
|
1215
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: FileImageTagViewComponent, isStandalone: true, selector: "croco-html-file-image-tag-view", inputs: { item: "item" }, ngImport: i0, template: "<img class=\"mx-auto d-block img-fluid\" [src]=\"imageSrc\" alt=\"\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043E\"/>", styles: [""] }); }
|
|
1167
1216
|
}
|
|
1168
1217
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FileImageTagViewComponent, decorators: [{
|
|
1169
1218
|
type: Component,
|
|
1170
|
-
args: [{ selector: 'croco-html-file-image-tag-view', standalone: true, template: "
|
|
1219
|
+
args: [{ selector: 'croco-html-file-image-tag-view', standalone: true, template: "<img class=\"mx-auto d-block img-fluid\" [src]=\"imageSrc\" alt=\"\u0418\u0437\u043E\u0431\u0440\u0430\u0436\u0435\u043D\u0438\u0435 \u043D\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043D\u043E\"/>" }]
|
|
1171
1220
|
}], propDecorators: { item: [{
|
|
1172
1221
|
type: Input
|
|
1173
1222
|
}] } });
|
|
@@ -1356,11 +1405,11 @@ class FileIdSelectComponent {
|
|
|
1356
1405
|
this.loadFiles();
|
|
1357
1406
|
}
|
|
1358
1407
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FileIdSelectComponent, deps: [{ token: FilesQueryService }, { token: CrocoHtmlOptionsToken }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1359
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: FileIdSelectComponent, isStandalone: true, selector: "croco-html-file-id-select", inputs: { labelText: "labelText", fileId: "fileId" }, outputs: { fileId: "fileId", onFileIdChanged: "onFileIdChanged" }, usesOnChanges: true, ngImport: i0, template: "<div>\n <div class=\"form-group\">\n <label for=\"fileName\">{{labelText}}</label>\n <ng-select [(ngModel)]=\"fileId\" (ngModelChange)=\"onModelChanged($event)\"
|
|
1408
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.4", type: FileIdSelectComponent, isStandalone: true, selector: "croco-html-file-id-select", inputs: { labelText: "labelText", fileId: "fileId" }, outputs: { fileId: "fileId", onFileIdChanged: "onFileIdChanged" }, usesOnChanges: true, ngImport: i0, template: "<div>\n <div class=\"form-group\">\n <label for=\"fileName\">{{labelText}}</label>\n <ng-select [(ngModel)]=\"fileId\" (ngModelChange)=\"onModelChanged($event)\" [items]=\"files\" #select\n bindLabel=\"fileName\" (search)=\"onSearchChanged($event)\" [loading]=\"loading\" [loadingText]=\"'\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u044E \u0444\u0430\u0439\u043B\u044B'\"\n dropdownPosition=\"auto\" bindValue=\"fileId\" labelForId=\"fileName\" placeholder=\"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B\"\n [virtualScroll]=\"true\">\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</div>\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>", styles: [""], dependencies: [{ kind: "ngmodule", type: NgSelectModule }, { kind: "component", type: i2$2.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i2$2.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] }); }
|
|
1360
1409
|
}
|
|
1361
1410
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: FileIdSelectComponent, decorators: [{
|
|
1362
1411
|
type: Component,
|
|
1363
|
-
args: [{ selector: 'croco-html-file-id-select', standalone: true, imports: [NgSelectModule, FormsModule], template: "<div>\n <div class=\"form-group\">\n <label for=\"fileName\">{{labelText}}</label>\n <ng-select [(ngModel)]=\"fileId\" (ngModelChange)=\"onModelChanged($event)\"
|
|
1412
|
+
args: [{ selector: 'croco-html-file-id-select', standalone: true, imports: [NgSelectModule, FormsModule], template: "<div>\n <div class=\"form-group\">\n <label for=\"fileName\">{{labelText}}</label>\n <ng-select [(ngModel)]=\"fileId\" (ngModelChange)=\"onModelChanged($event)\" [items]=\"files\" #select\n bindLabel=\"fileName\" (search)=\"onSearchChanged($event)\" [loading]=\"loading\" [loadingText]=\"'\u0417\u0430\u0433\u0440\u0443\u0436\u0430\u044E \u0444\u0430\u0439\u043B\u044B'\"\n dropdownPosition=\"auto\" bindValue=\"fileId\" labelForId=\"fileName\" placeholder=\"\u0412\u044B\u0431\u0440\u0430\u0442\u044C \u0444\u0430\u0439\u043B\"\n [virtualScroll]=\"true\">\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</div>\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>" }]
|
|
1364
1413
|
}], ctorParameters: () => [{ type: FilesQueryService }, { type: undefined, decorators: [{
|
|
1365
1414
|
type: Inject,
|
|
1366
1415
|
args: [CrocoHtmlOptionsToken]
|
|
@@ -1374,15 +1423,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImpor
|
|
|
1374
1423
|
type: Output
|
|
1375
1424
|
}] } });
|
|
1376
1425
|
|
|
1426
|
+
class ScreenWidthService {
|
|
1427
|
+
constructor() {
|
|
1428
|
+
this.screenWidth = new BehaviorSubject(window.innerWidth);
|
|
1429
|
+
window.addEventListener('resize', this.onResize.bind(this));
|
|
1430
|
+
}
|
|
1431
|
+
onResize(event) {
|
|
1432
|
+
this.screenWidth.next(window.innerWidth);
|
|
1433
|
+
}
|
|
1434
|
+
getScreenWidth() {
|
|
1435
|
+
return this.screenWidth.asObservable();
|
|
1436
|
+
}
|
|
1437
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ScreenWidthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1438
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ScreenWidthService, providedIn: 'root' }); }
|
|
1439
|
+
}
|
|
1440
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ScreenWidthService, decorators: [{
|
|
1441
|
+
type: Injectable,
|
|
1442
|
+
args: [{
|
|
1443
|
+
providedIn: 'root'
|
|
1444
|
+
}]
|
|
1445
|
+
}], ctorParameters: () => [] });
|
|
1446
|
+
|
|
1377
1447
|
class ImageEditorComponent {
|
|
1378
1448
|
onErrorHandler() {
|
|
1379
1449
|
this.hasImageError = true;
|
|
1380
1450
|
}
|
|
1381
|
-
constructor(_options) {
|
|
1451
|
+
constructor(_options, screenWidth) {
|
|
1382
1452
|
this._options = _options;
|
|
1383
1453
|
this.hasImageError = false;
|
|
1384
1454
|
this.searchOrEdit = "search";
|
|
1455
|
+
this.requests = [];
|
|
1456
|
+
this.imageMaxHeight = null;
|
|
1457
|
+
this.isShowMediaRequest = false;
|
|
1458
|
+
this.unsubscribe = new Subject();
|
|
1385
1459
|
this.onTagUpdated = new EventEmitter();
|
|
1460
|
+
screenWidth.getScreenWidth()
|
|
1461
|
+
.pipe(takeUntil(this.unsubscribe))
|
|
1462
|
+
.subscribe(screenWidth => {
|
|
1463
|
+
this.imageMaxHeight = ImageMethods.screenSizeChanged(screenWidth, this.requests);
|
|
1464
|
+
});
|
|
1386
1465
|
}
|
|
1387
1466
|
getSrc() {
|
|
1388
1467
|
return ImageMethods.buildUrl(this.tag.attributes[FileImageTagDataConsts.FileIdAttrName], "Medium", this._options);
|
|
@@ -1398,17 +1477,36 @@ class ImageEditorComponent {
|
|
|
1398
1477
|
this.hasImageError = false;
|
|
1399
1478
|
}
|
|
1400
1479
|
ngOnInit() {
|
|
1480
|
+
let attr = this.tag.attributes[FileImageTagDataConsts.ScreenMediaRequest];
|
|
1481
|
+
this.requests = ImageMethods.mediaRequestStringToArrayParser(attr);
|
|
1482
|
+
}
|
|
1483
|
+
requestChanged() {
|
|
1484
|
+
this.tag.attributes[FileImageTagDataConsts.ScreenMediaRequest] = ImageMethods.mediaRequestsArrayToStringParser(this.requests);
|
|
1401
1485
|
}
|
|
1402
|
-
|
|
1403
|
-
|
|
1486
|
+
addNewMediaRequest() {
|
|
1487
|
+
this.requests.push({
|
|
1488
|
+
screenWidth: 0,
|
|
1489
|
+
maxImageHeight: 0,
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
deleteMediaRequest(index) {
|
|
1493
|
+
this.requests.splice(index, 1);
|
|
1494
|
+
this.requestChanged();
|
|
1495
|
+
}
|
|
1496
|
+
ngOnDestroy() {
|
|
1497
|
+
this.unsubscribe.next();
|
|
1498
|
+
this.unsubscribe.complete();
|
|
1499
|
+
}
|
|
1500
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ImageEditorComponent, deps: [{ token: CrocoHtmlOptionsToken }, { token: ScreenWidthService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1501
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: ImageEditorComponent, isStandalone: true, selector: "croco-html-image-editor", inputs: { tag: "tag" }, outputs: { onTagUpdated: "onTagUpdated" }, ngImport: i0, template: "<div>\n <div style=\"height: 10px;\">\n </div>\n\n @if (hasImageError) {\n <div 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\n @if (hasFileId() && !hasImageError) {\n <div>\n <img\n [ngStyle]=\"{ 'max-height': imageMaxHeight ? imageMaxHeight + 'px' : '100%'}\"\n class=\"mx-auto d-block img-fluid\" [src]=\"getSrc()\" (error)=\"onErrorHandler()\" alt=\"photo\"/>\n </div>\n }\n\n @if (!hasFileId()) {\n <div>\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 }\n\n @if(!tag.presentOrEdit) {\n <mat-slide-toggle style=\"padding: 10px 0\" [(ngModel)]=\"isShowMediaRequest\">\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043C\u0435\u0434\u0438\u0430 \u0437\u0430\u043F\u0440\u043E\u0441\u044B</mat-slide-toggle>\n }\n\n @if(isShowMediaRequest) {\n <div style=\"display: flex; flex-direction: column; gap: 20px\">\n <div class=\"media-request__header\">\n <span>\u041C\u0435\u0434\u0438\u0430 \u0437\u0430\u043F\u0440\u043E\u0441\u044B:</span>\n @if (!tag.presentOrEdit) {\n <button (click)=\"addNewMediaRequest()\" class=\"w-30\" mat-icon-button color=\"primary\">\n <mat-icon>add</mat-icon>\n </button>\n }\n </div>\n @for (request of requests; track $index) {\n <div class=\"media-request__container\">\n @if (tag.presentOrEdit) {\n <div style=\"display: flex; flex-direction: column; gap: 5px\">\n <span class=\"w-100\">\u0413\u0440\u0430\u043D\u0438\u0446\u0430 \u0448\u0438\u0440\u0438\u043D\u044B: {{request.screenWidth}}</span>\n <span class=\"w-100\">\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0432\u044B\u0441\u043E\u0442\u0430: {{request.maxImageHeight}}</span>\n </div>\n }\n\n @if (!tag.presentOrEdit) {\n <div style=\"width: 100%\">\n <mat-form-field class=\"w-100\">\n <mat-label>\n \u0413\u0440\u0430\u043D\u0438\u0446\u0430 \u0448\u0438\u0440\u0438\u043D\u044B\n </mat-label>\n <input matInput placeholder=\"\u0413\u0440\u0430\u043D\u0438\u0446\u0430 \u0448\u0438\u0440\u0438\u043D\u044B\"\n autocomplete=\"off\"\n [(ngModel)]=\"request.screenWidth\"\n (ngModelChange)=\"requestChanged()\">\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>\n \u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0432\u044B\u0441\u043E\u0442\u0430\n </mat-label>\n <input matInput placeholder=\" \u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0432\u044B\u0441\u043E\u0442\u0430\"\n autocomplete=\"off\"\n [(ngModel)]=\"request.maxImageHeight\"\n (ngModelChange)=\"requestChanged()\">\n </mat-form-field>\n </div>\n\n <button (click)=\"deleteMediaRequest($index)\" class=\"w-30\" mat-icon-button color=\"warn\">\n <mat-icon>delete</mat-icon>\n </button>\n }\n </div>\n }\n </div>\n }\n</div>\n\n@if (!tag.presentOrEdit) {\n <div>\n <div style=\"height: 10px;\"></div>\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 <div style=\"height: 10px;\"></div>\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 <div [hidden]=\"searchOrEdit !== 'edit'\">\n <div>\n <mat-form-field class=\"w-100\">\n <mat-label>\n \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430\n </mat-label>\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 type=\"number\"\n [(ngModel)]=\"tag.attributes['file-id']\"\n (ngModelChange)=\"removeImageError()\">\n </mat-form-field>\n </div>\n </div>\n </div>\n}\n", styles: [".error-block{background-color:#f32323;color:#fff;text-align:center;border-radius:10px;padding:10px}.media-request__header{align-items:center;display:flex;width:100%;justify-content:space-between}.media-request__container{display:flex;align-items:center;border-bottom:1px solid rgba(128,128,128,.7);padding-bottom:10px}\n"], dependencies: [{ kind: "directive", type: MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: ["appearance", "name", "vertical", "value", "multiple", "disabled", "hideSingleSelectionIndicator", "hideMultipleSelectionIndicator"], outputs: ["valueChange", "change"], exportAs: ["matButtonToggleGroup"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1$4.NumberValueAccessor, selector: "input[type=number][formControlName],input[type=number][formControl],input[type=number][ngModel]" }, { kind: "directive", type: i1$4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: MatButtonToggle, selector: "mat-button-toggle", inputs: ["aria-label", "aria-labelledby", "id", "name", "value", "tabIndex", "disableRipple", "appearance", "checked", "disabled"], outputs: ["change"], exportAs: ["matButtonToggle"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: FileIdSelectComponent, selector: "croco-html-file-id-select", inputs: ["labelText", "fileId"], outputs: ["fileId", "onFileIdChanged"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: MatSlideToggle, selector: "mat-slide-toggle", inputs: ["name", "id", "labelPosition", "aria-label", "aria-labelledby", "aria-describedby", "required", "color", "disabled", "disableRipple", "tabIndex", "checked", "hideIcon"], outputs: ["change", "toggleChange"], exportAs: ["matSlideToggle"] }] }); }
|
|
1404
1502
|
}
|
|
1405
1503
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: ImageEditorComponent, decorators: [{
|
|
1406
1504
|
type: Component,
|
|
1407
|
-
args: [{ selector: 'croco-html-image-editor', standalone: true, imports: [MatButtonToggleGroup, FormsModule, MatButtonToggle, MatIcon, FileIdSelectComponent, MatFormField, MatLabel, MatInput], template: "<div>\n <div style=\"height: 10px;\">\n </div>\n\n @if (hasImageError) {\n <div 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\n @if (hasFileId() && !hasImageError) {\n <div>\n <img class=\"mx-auto d-block img-fluid\" [src]=\"getSrc()\" (error)=\"onErrorHandler()\"/>\n </div>\n }\n\n @if (!hasFileId()) {\n <div>\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 }\n</div>\n\n@if (!tag.presentOrEdit) {\n <div>\n <div style=\"height: 10px;\"></div>\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 <div style=\"height: 10px;\"></div>\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 <div [hidden]=\"searchOrEdit !== 'edit'\">\n <div>\n <mat-form-field class=\"w-100\">\n <mat-label>\n \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430\n </mat-label>\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 type=\"number\"\n [(ngModel)]=\"tag.attributes['file-id']\"\n (ngModelChange)=\"removeImageError()\">\n </mat-form-field>\n </div>\n </div>\n </div>\n}", styles: [".error-block{background-color:#f32323;color:#fff;text-align:center;border-radius:10px;padding:10px}\n"] }]
|
|
1505
|
+
args: [{ selector: 'croco-html-image-editor', standalone: true, imports: [MatButtonToggleGroup, FormsModule, MatButtonToggle, MatIcon, FileIdSelectComponent, MatFormField, MatLabel, MatInput, CdkDragHandle, MatCard, MatCardContent, XmlTagExternalVideoComponent, NgStyle, MatButton, MatIconButton, MatSlideToggle], template: "<div>\n <div style=\"height: 10px;\">\n </div>\n\n @if (hasImageError) {\n <div 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\n @if (hasFileId() && !hasImageError) {\n <div>\n <img\n [ngStyle]=\"{ 'max-height': imageMaxHeight ? imageMaxHeight + 'px' : '100%'}\"\n class=\"mx-auto d-block img-fluid\" [src]=\"getSrc()\" (error)=\"onErrorHandler()\" alt=\"photo\"/>\n </div>\n }\n\n @if (!hasFileId()) {\n <div>\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 }\n\n @if(!tag.presentOrEdit) {\n <mat-slide-toggle style=\"padding: 10px 0\" [(ngModel)]=\"isShowMediaRequest\">\u041F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043C\u0435\u0434\u0438\u0430 \u0437\u0430\u043F\u0440\u043E\u0441\u044B</mat-slide-toggle>\n }\n\n @if(isShowMediaRequest) {\n <div style=\"display: flex; flex-direction: column; gap: 20px\">\n <div class=\"media-request__header\">\n <span>\u041C\u0435\u0434\u0438\u0430 \u0437\u0430\u043F\u0440\u043E\u0441\u044B:</span>\n @if (!tag.presentOrEdit) {\n <button (click)=\"addNewMediaRequest()\" class=\"w-30\" mat-icon-button color=\"primary\">\n <mat-icon>add</mat-icon>\n </button>\n }\n </div>\n @for (request of requests; track $index) {\n <div class=\"media-request__container\">\n @if (tag.presentOrEdit) {\n <div style=\"display: flex; flex-direction: column; gap: 5px\">\n <span class=\"w-100\">\u0413\u0440\u0430\u043D\u0438\u0446\u0430 \u0448\u0438\u0440\u0438\u043D\u044B: {{request.screenWidth}}</span>\n <span class=\"w-100\">\u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0432\u044B\u0441\u043E\u0442\u0430: {{request.maxImageHeight}}</span>\n </div>\n }\n\n @if (!tag.presentOrEdit) {\n <div style=\"width: 100%\">\n <mat-form-field class=\"w-100\">\n <mat-label>\n \u0413\u0440\u0430\u043D\u0438\u0446\u0430 \u0448\u0438\u0440\u0438\u043D\u044B\n </mat-label>\n <input matInput placeholder=\"\u0413\u0440\u0430\u043D\u0438\u0446\u0430 \u0448\u0438\u0440\u0438\u043D\u044B\"\n autocomplete=\"off\"\n [(ngModel)]=\"request.screenWidth\"\n (ngModelChange)=\"requestChanged()\">\n </mat-form-field>\n\n <mat-form-field class=\"w-100\">\n <mat-label>\n \u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0432\u044B\u0441\u043E\u0442\u0430\n </mat-label>\n <input matInput placeholder=\" \u041C\u0430\u043A\u0441\u0438\u043C\u0430\u043B\u044C\u043D\u0430\u044F \u0432\u044B\u0441\u043E\u0442\u0430\"\n autocomplete=\"off\"\n [(ngModel)]=\"request.maxImageHeight\"\n (ngModelChange)=\"requestChanged()\">\n </mat-form-field>\n </div>\n\n <button (click)=\"deleteMediaRequest($index)\" class=\"w-30\" mat-icon-button color=\"warn\">\n <mat-icon>delete</mat-icon>\n </button>\n }\n </div>\n }\n </div>\n }\n</div>\n\n@if (!tag.presentOrEdit) {\n <div>\n <div style=\"height: 10px;\"></div>\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 <div style=\"height: 10px;\"></div>\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 <div [hidden]=\"searchOrEdit !== 'edit'\">\n <div>\n <mat-form-field class=\"w-100\">\n <mat-label>\n \u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0444\u0430\u0439\u043B\u0430\n </mat-label>\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 type=\"number\"\n [(ngModel)]=\"tag.attributes['file-id']\"\n (ngModelChange)=\"removeImageError()\">\n </mat-form-field>\n </div>\n </div>\n </div>\n}\n", styles: [".error-block{background-color:#f32323;color:#fff;text-align:center;border-radius:10px;padding:10px}.media-request__header{align-items:center;display:flex;width:100%;justify-content:space-between}.media-request__container{display:flex;align-items:center;border-bottom:1px solid rgba(128,128,128,.7);padding-bottom:10px}\n"] }]
|
|
1408
1506
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
1409
1507
|
type: Inject,
|
|
1410
1508
|
args: [CrocoHtmlOptionsToken]
|
|
1411
|
-
}] }], propDecorators: { tag: [{
|
|
1509
|
+
}] }, { type: ScreenWidthService }], propDecorators: { tag: [{
|
|
1412
1510
|
type: Input
|
|
1413
1511
|
}], onTagUpdated: [{
|
|
1414
1512
|
type: Output
|
|
@@ -1592,6 +1690,9 @@ class VisualEditorComponent {
|
|
|
1592
1690
|
attrs[ExternalVideoTagDataConsts.VideoTypeAttrName] = this.selectedVideoPlayer;
|
|
1593
1691
|
attrs[ExternalVideoTagDataConsts.LinkAttrName] = this.selectedVideoPlayer === ExternalVideoSupportedTypes.VkVideo ? defaultLinkVk : defaultLinkYouTube;
|
|
1594
1692
|
}
|
|
1693
|
+
else if (tagDescription.tag == FileImageTagDataConsts.TagName) {
|
|
1694
|
+
attrs[FileImageTagDataConsts.ScreenMediaRequest] = FileImageTagDataConsts.DefaultValueForFileImage;
|
|
1695
|
+
}
|
|
1595
1696
|
else if (tagDescription.tag == DownloadButtonTagDataConsts.TagName) {
|
|
1596
1697
|
attrs[DownloadButtonTagDataConsts.LinkAttrName] = defaultLinkForDownload;
|
|
1597
1698
|
attrs[DownloadButtonTagDataConsts.TitleAttrName] = 'Скачать';
|