@worktile/theia 16.3.13 → 16.3.15

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.
@@ -24,7 +24,7 @@ import { ThyDropdownDirective, ThyDropdownModule } from 'ngx-tethys/dropdown';
24
24
  import * as i8 from 'ngx-tethys/tooltip';
25
25
  import { ThyTooltipModule } from 'ngx-tethys/tooltip';
26
26
  import { DOWN_ARROW, UP_ARROW, RIGHT_ARROW, LEFT_ARROW, ENTER } from '@angular/cdk/keycodes';
27
- import { fromEvent, Subject, combineLatest, Observable, timer, BehaviorSubject, merge, ReplaySubject } from 'rxjs';
27
+ import { fromEvent, Subject, combineLatest, Observable, timer, firstValueFrom, BehaviorSubject, merge, ReplaySubject } from 'rxjs';
28
28
  import { debounceTime, takeUntil, startWith, distinctUntilChanged, skip, map as map$1, share, take, delay, filter, mapTo, pairwise } from 'rxjs/operators';
29
29
  import { mixinUnsubscribe, MixinBase, ScrollToService } from 'ngx-tethys/core';
30
30
  import { isKeyHotkey } from 'is-hotkey';
@@ -49,7 +49,7 @@ import { ThyColorPickerModule } from 'ngx-tethys/color-picker';
49
49
  import { marked } from 'marked';
50
50
  import * as i1$3 from 'ngx-tethys/alert';
51
51
  import { ThyAlertModule } from 'ngx-tethys/alert';
52
- import * as i4$1 from 'ngx-tethys/image';
52
+ import * as i1$4 from 'ngx-tethys/image';
53
53
  import { ThyImageDirective, ThyImageModule } from 'ngx-tethys/image';
54
54
  import { ThyUploadStatus } from 'ngx-tethys/upload';
55
55
  import * as i9$1 from 'ngx-tethys/progress';
@@ -5735,6 +5735,9 @@ class TheContextService {
5735
5735
  this.uploadingFiles.push(file);
5736
5736
  }
5737
5737
  removeUploadFile(file) {
5738
+ if (!file) {
5739
+ return;
5740
+ }
5738
5741
  this.uploadingFiles.splice(this.uploadingFiles.findIndex(item => item.url === file.url), 1);
5739
5742
  }
5740
5743
  ngOnDestroy() {
@@ -5800,6 +5803,23 @@ const ImageEditor = {
5800
5803
  file: new File([blob], `${new Date().getTime()}.${ext}`, { type: contentType })
5801
5804
  });
5802
5805
  },
5806
+ handleExternalImageElement(editor, image) {
5807
+ const contextService = editor.injector.get(TheContextService);
5808
+ const imageUploaderService = editor.injector.get(THE_UPLOAD_SERVICE_TOKEN);
5809
+ const isExternalUrl = image?.hasOwnProperty('externalUrl')
5810
+ ? image?.externalUrl
5811
+ : imageUploaderService.isExternalUrl?.(image.thumbUrl);
5812
+ if (isExternalUrl) {
5813
+ const url = image.thumbUrl;
5814
+ image.url = url;
5815
+ image.externalUrl = url;
5816
+ image.thumbUrl = null;
5817
+ contextService.addUploadingFiles({
5818
+ url: image.url,
5819
+ file: image.url
5820
+ });
5821
+ }
5822
+ },
5803
5823
  verifyImage(editor, image) {
5804
5824
  if (!PICTURE_ACCEPTED_UPLOAD_MIME.includes(image.type)) {
5805
5825
  editor.onError({
@@ -5835,20 +5855,6 @@ const ImageEditor = {
5835
5855
  isBase64(url) {
5836
5856
  return isString(url) && url.includes('base64');
5837
5857
  },
5838
- /**
5839
- * 设置图片来源
5840
- * @param editor 编辑器对象
5841
- * @param image 图片节点
5842
- */
5843
- setImageSource(editor, image) {
5844
- const imageUploaderService = editor.injector.get(THE_UPLOAD_SERVICE_TOKEN);
5845
- const externalSource = image?.hasOwnProperty('externalSource')
5846
- ? image?.externalSource
5847
- : imageUploaderService.isExternalSource?.(image.thumbUrl);
5848
- if (externalSource) {
5849
- image.externalSource = externalSource;
5850
- }
5851
- },
5852
5858
  removeImage(editor, image) {
5853
5859
  if (image) {
5854
5860
  deleteElement(editor, image);
@@ -6267,11 +6273,11 @@ const MentionEditor = {
6267
6273
  scrollStrategy: overlay.scrollStrategies.reposition(),
6268
6274
  autoAdaptive: true
6269
6275
  });
6276
+ THE_EDITOR_POPOVER_REF.set(editor, popoverRef);
6270
6277
  popoverRef?.afterClosed().subscribe(() => {
6271
6278
  MentionEditor.close(editor);
6272
6279
  });
6273
6280
  MentionEditor.updatePositionStrategy(editor, isSoftBreak);
6274
- THE_EDITOR_POPOVER_REF.set(editor, popoverRef);
6275
6281
  cdr.markForCheck();
6276
6282
  },
6277
6283
  close(editor) {
@@ -8636,7 +8642,7 @@ const withDeserializeHTML = (editor) => {
8636
8642
  ImageEditor.handleBase64ImageElement(editor, node);
8637
8643
  }
8638
8644
  else {
8639
- ImageEditor.setImageSource(editor, node);
8645
+ ImageEditor.handleExternalImageElement(editor, node);
8640
8646
  }
8641
8647
  }
8642
8648
  });
@@ -8750,7 +8756,7 @@ const withDeserializeMd = (editor) => {
8750
8756
  ImageEditor.handleBase64ImageElement(editor, node);
8751
8757
  }
8752
8758
  else {
8753
- ImageEditor.setImageSource(editor, node);
8759
+ ImageEditor.handleExternalImageElement(editor, node);
8754
8760
  }
8755
8761
  }
8756
8762
  });
@@ -9142,16 +9148,17 @@ class TheImageComponent extends TheBaseElementComponent {
9142
9148
  ? this.layoutDefaultWidth
9143
9149
  : this.imageEntry.width;
9144
9150
  }
9145
- constructor(elementRef, imageUploaderService, cdr, theContextService, thyPopover, overlay, viewContainerRef, imageGroupComponent) {
9151
+ constructor(elementRef, cdr, imageGroupComponent, imageUploaderService, theContextService, thyPopover, overlay, viewContainerRef, destroyRef) {
9146
9152
  super(elementRef, cdr);
9147
9153
  this.elementRef = elementRef;
9148
- this.imageUploaderService = imageUploaderService;
9149
9154
  this.cdr = cdr;
9155
+ this.imageGroupComponent = imageGroupComponent;
9156
+ this.imageUploaderService = imageUploaderService;
9150
9157
  this.theContextService = theContextService;
9151
9158
  this.thyPopover = thyPopover;
9152
9159
  this.overlay = overlay;
9153
9160
  this.viewContainerRef = viewContainerRef;
9154
- this.imageGroupComponent = imageGroupComponent;
9161
+ this.destroyRef = destroyRef;
9155
9162
  this.naturalWidth = 0;
9156
9163
  this.naturalHeight = 0;
9157
9164
  this.imageEntry = {};
@@ -9204,68 +9211,35 @@ class TheImageComponent extends TheBaseElementComponent {
9204
9211
  this.dragable = false;
9205
9212
  this.beforeContextChange = (value) => {
9206
9213
  if (value.element !== this.element && value.element.thumbUrl) {
9207
- const externalSource = value.element?.externalSource;
9208
9214
  let thumbUrl = value.element.thumbUrl;
9209
9215
  let originUrl = value.element.originUrl;
9210
- if (!externalSource && this.imageUploaderService?.buildImageUrl) {
9216
+ if (this.imageUploaderService?.buildImageUrl) {
9211
9217
  thumbUrl = this.imageUploaderService.buildImageUrl(thumbUrl);
9212
9218
  originUrl = this.imageUploaderService.buildImageUrl(originUrl);
9213
9219
  }
9214
9220
  this.imageEntry = {
9215
- name: value.element.name,
9216
- width: value.element.width,
9217
- height: value.element.height,
9218
- align: value.element.align || Alignment.left,
9219
- layout: value.element.layout,
9220
- reSized: value.element.reSized || false,
9221
- size: value.element.size,
9221
+ ...value.element,
9222
9222
  thumbUrl,
9223
- originUrl
9223
+ originUrl,
9224
+ align: value.element.align || Alignment.left,
9225
+ reSized: value.element.reSized || false
9224
9226
  };
9225
9227
  this.setBlockCardLayoutAttr();
9226
9228
  }
9227
9229
  };
9228
9230
  }
9229
9231
  ngOnInit() {
9230
- this.fileItem = this.theContextService.uploadingFiles.find(item => item.url === this.element.url);
9231
- if (this.fileItem?.file && this.fileItem.file instanceof File) {
9232
- this.uploadImage(this.fileItem.file);
9233
- }
9234
9232
  super.ngOnInit();
9235
- this.imagePluginOptions = getPluginOptions(this.editor, PluginKeys.image);
9236
- if (this.imagePluginOptions.disablePreview && typeof this.imagePluginOptions.disablePreview === 'function') {
9237
- this.disablePreview = this.imagePluginOptions.disablePreview(this.editor);
9238
- }
9239
- else {
9240
- this.disablePreview = this.imagePluginOptions.disablePreview;
9233
+ this.setImageFileItem();
9234
+ if (this.fileItem?.file) {
9235
+ this.uploadImage();
9241
9236
  }
9237
+ this.setImagePluginOptions();
9238
+ this.setDisablePreview();
9242
9239
  }
9243
- imageClick() {
9244
- const index = this.imageGroupComponent.images.findIndex(item => item === this.imageDirective);
9245
- const imageGroup = this.imageGroupComponent.images.map(item => {
9246
- return {
9247
- originUrl: item.thyOriginSrc,
9248
- thumbUrl: item.thyPreviewSrc,
9249
- name: item.thyImageMeta.name,
9250
- size: item.thyImageMeta.size
9251
- };
9252
- });
9253
- const { originUrl, thumbUrl, name, size } = this.element;
9254
- if (this.imagePluginOptions.preview) {
9255
- this.imagePluginOptions.preview({
9256
- editor: this.editor,
9257
- previewImageInfo: {
9258
- image: {
9259
- originUrl,
9260
- thumbUrl,
9261
- name,
9262
- size
9263
- },
9264
- imageGroup,
9265
- index
9266
- }
9267
- });
9268
- }
9240
+ ngAfterViewInit() {
9241
+ this.subscribeMouseUp();
9242
+ this.subscribeImageUploadingState();
9269
9243
  }
9270
9244
  onContextChange() {
9271
9245
  super.onContextChange();
@@ -9280,18 +9254,35 @@ class TheImageComponent extends TheBaseElementComponent {
9280
9254
  }
9281
9255
  ngOnDestroy() {
9282
9256
  this.uploadingSubscription.unsubscribe();
9283
- this.mouseUpSubscription.unsubscribe();
9284
9257
  this.theContextService.removeUploadFile(this.fileItem);
9285
9258
  if (this.uploading) {
9286
9259
  this.theContextService.uploadingStatus$.next(false);
9287
9260
  }
9288
9261
  super.ngOnDestroy();
9289
9262
  }
9290
- ngAfterViewInit() {
9291
- this.mouseUpSubscription = this.theContextService.onMouseUp$.subscribe(e => this.endDrag(e));
9263
+ setImagePluginOptions() {
9264
+ this.imagePluginOptions = getPluginOptions(this.editor, PluginKeys.image);
9265
+ }
9266
+ setDisablePreview() {
9267
+ const { disablePreview } = this.imagePluginOptions;
9268
+ if (disablePreview && typeof disablePreview === 'function') {
9269
+ this.disablePreview = disablePreview(this.editor);
9270
+ }
9271
+ else {
9272
+ this.disablePreview = disablePreview;
9273
+ }
9274
+ }
9275
+ setImageFileItem() {
9276
+ this.fileItem = this.theContextService.uploadingFiles.find(item => item.url === this.element.url);
9277
+ }
9278
+ subscribeMouseUp() {
9279
+ this.theContextService.onMouseUp$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(e => this.endDrag(e));
9280
+ }
9281
+ subscribeImageUploadingState() {
9292
9282
  this.uploadingSubscription = this.imageUploaderService
9293
9283
  .getUploadingItems$()
9294
- .pipe(map$1(fileUploadingItem => this.fileItem?.file && fileUploadingItem.find(item => item.file === this.fileItem?.file)))
9284
+ .pipe(map$1(fileUploadingItem => this.fileItem?.file &&
9285
+ fileUploadingItem.find(item => item.file === this.fileItem?.file || item?.url === this.fileItem?.file)))
9295
9286
  .subscribe(uploadingItem => {
9296
9287
  if (!uploadingItem || !uploadingItem.result) {
9297
9288
  return;
@@ -9313,21 +9304,24 @@ class TheImageComponent extends TheBaseElementComponent {
9313
9304
  const data = { type: ElementKinds.image, url: null, ...imageInfo };
9314
9305
  HistoryEditor.withoutSaving(this.editor, () => Transforms.setNodes(this.editor, data, { at: path }));
9315
9306
  }
9316
- async uploadImage(file) {
9317
- this.imageEntry = {
9318
- align: this.imageEntry.align || Alignment.center,
9319
- thumbUrl: URL.createObjectURL(file)
9320
- };
9307
+ async uploadImage() {
9321
9308
  this.uploading = true;
9309
+ const file = this.fileItem.file;
9310
+ if (file instanceof File) {
9311
+ this.imageEntry = {
9312
+ align: this.imageEntry.align || Alignment.center,
9313
+ thumbUrl: URL.createObjectURL(file)
9314
+ };
9315
+ }
9322
9316
  this.theContextService.uploadingStatus$.next(true);
9323
- const [uploadFileEntity] = await this.imageUploaderService.uploadFileHandle([file]).toPromise();
9324
- const { thumbUrl, originUrl } = uploadFileEntity;
9317
+ const [fileEntity] = await firstValueFrom(this.imageUploaderService.uploadFileHandle(file));
9318
+ const { name, size, thumbUrl, originUrl } = fileEntity;
9325
9319
  const imageInfo = {
9326
- name: file.name,
9320
+ name,
9327
9321
  thumbUrl,
9328
9322
  originUrl,
9329
- align: this.imageEntry.align || Alignment.center,
9330
- size: file.size
9323
+ size,
9324
+ align: this.imageEntry.align || Alignment.center
9331
9325
  };
9332
9326
  this.setImageNodes(imageInfo);
9333
9327
  }
@@ -9519,16 +9513,43 @@ class TheImageComponent extends TheBaseElementComponent {
9519
9513
  event.preventDefault();
9520
9514
  event.stopPropagation();
9521
9515
  }
9522
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TheImageComponent, deps: [{ token: i0.ElementRef }, { token: THE_UPLOAD_SERVICE_TOKEN }, { token: i0.ChangeDetectorRef }, { token: TheContextService }, { token: i1.ThyPopover }, { token: i2.Overlay }, { token: i0.ViewContainerRef }, { token: i4$1.ThyImageGroupComponent }], target: i0.ɵɵFactoryTarget.Component }); }
9523
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TheImageComponent, selector: "the-image, [theImage]", viewQueries: [{ propertyName: "imageContent", first: true, predicate: ["imageContent"], descendants: true }, { propertyName: "img", first: true, predicate: ["img"], descendants: true }, { propertyName: "layoutToolbar", first: true, predicate: ["layoutToolbar"], descendants: true, static: true }, { propertyName: "imageDirective", first: true, predicate: ThyImageDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div #imageContent *ngIf=\"imageEntry.thumbUrl\" class=\"image-content\" [class.cursor-pointer]=\"!selection\">\n <img\n #img\n thyImage\n class=\"main-image\"\n [class.image-collapsed]=\"selection && !uploading\"\n [ngStyle]=\"{ 'width.px': imageBindingWidth }\"\n [alt]=\"imageEntry.name\"\n [thySrc]=\"imageEntry.thumbUrl\"\n [thyPreviewSrc]=\"imageEntry.thumbUrl\"\n [thyOriginSrc]=\"imageEntry.originUrl\"\n [thyDisablePreview]=\"disablePreview\"\n [thyImageMeta]=\"{ name: imageEntry.name, size: imageEntry.size }\"\n (load)=\"imageLoaded($event)\"\n (mousedown)=\"preventDefault($event)\"\n (error)=\"imageError($event)\"\n (click)=\"imageClick($event)\"\n />\n <div *ngIf=\"isCollapsedAndNonReadonly\" class=\"image-profile\" [class.outline]=\"selection\">\n <ng-container *ngIf=\"!loadImageError\">\n <span (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left bottom\"></span>\n </ng-container>\n </div>\n <div *ngIf=\"uploading\" class=\"uploading\">\n <div class=\"uploading-percentage\">\n <thy-progress thyType=\"primary\" [thyValue]=\"percentage\" thySize=\"sm\"></thy-progress>\n <thy-icon (click)=\"cancelUpload($event)\" thyIconName=\"close-circle-bold-fill\" thyIconLegging=\"true\"> </thy-icon>\n </div>\n </div>\n <div *ngIf=\"!uploading\" class=\"layer\" [class.readonly]=\"readonly\"></div>\n </div>\n <div *ngIf=\"!imageEntry.thumbUrl\" class=\"image-loading cursor-pointer\" contenteditable=\"false\">\n <thy-icon thyIconName=\"image\"></thy-icon>\n </div>\n</div>\n\n<ng-template #layoutToolbar>\n <thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of layoutOptions\">\n <a\n *ngIf=\"item.key !== 'split'\"\n href=\"javascript:;\"\n thyAction\n [thyType]=\"item.key === 'remove' ? 'danger' : 'primary'\"\n [thyActionIcon]=\"item.icon\"\n [thyActionActive]=\"layoutActive(item.key)\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"item?.handle($event, item.key)\"\n ></a>\n <thy-divider *ngIf=\"item.key === 'split'\" class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\" thyColor=\"light\"></thy-divider>\n </ng-container>\n </thy-actions>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i1$1.SlateChildren, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { kind: "component", type: i4.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i9$1.ThyProgressComponent, selector: "thy-progress", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips", "thyShape", "thyGapDegree", "thyGapPosition", "thyStrokeWidth"] }, { kind: "directive", type: i4$1.ThyImageDirective, selector: "img[thyImage]", inputs: ["thySrc", "thyPreviewSrc", "thyOriginSrc", "thyImageMeta", "thyDisablePreview", "thyResolveSize"], exportAs: ["thyImage"] }, { kind: "component", type: i7.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i7.ThyActionsComponent, selector: "thy-actions", inputs: ["thySize"] }, { kind: "component", type: i8$1.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }] }); }
9516
+ imageClick() {
9517
+ const index = this.imageGroupComponent.images.findIndex(item => item === this.imageDirective);
9518
+ const imageGroup = this.imageGroupComponent.images.map(item => {
9519
+ return {
9520
+ originUrl: item.thyOriginSrc,
9521
+ thumbUrl: item.thyPreviewSrc,
9522
+ name: item.thyImageMeta.name,
9523
+ size: item.thyImageMeta.size
9524
+ };
9525
+ });
9526
+ const { originUrl, thumbUrl, name, size } = this.element;
9527
+ if (this.imagePluginOptions.preview) {
9528
+ this.imagePluginOptions.preview({
9529
+ editor: this.editor,
9530
+ previewImageInfo: {
9531
+ image: {
9532
+ originUrl,
9533
+ thumbUrl,
9534
+ name,
9535
+ size
9536
+ },
9537
+ imageGroup,
9538
+ index
9539
+ }
9540
+ });
9541
+ }
9542
+ }
9543
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TheImageComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1$4.ThyImageGroupComponent }, { token: THE_UPLOAD_SERVICE_TOKEN }, { token: TheContextService }, { token: i1.ThyPopover }, { token: i2.Overlay }, { token: i0.ViewContainerRef }, { token: i0.DestroyRef }], target: i0.ɵɵFactoryTarget.Component }); }
9544
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: TheImageComponent, selector: "the-image, [theImage]", viewQueries: [{ propertyName: "imageContent", first: true, predicate: ["imageContent"], descendants: true }, { propertyName: "img", first: true, predicate: ["img"], descendants: true }, { propertyName: "layoutToolbar", first: true, predicate: ["layoutToolbar"], descendants: true, static: true }, { propertyName: "imageDirective", first: true, predicate: ThyImageDirective, descendants: true }], usesInheritance: true, ngImport: i0, template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div #imageContent *ngIf=\"imageEntry.thumbUrl; else imageLoading\" class=\"image-content\" [class.cursor-pointer]=\"!selection\">\n <img\n #img\n thyImage\n class=\"main-image\"\n [class.image-collapsed]=\"selection && !uploading\"\n [ngStyle]=\"{ 'width.px': imageBindingWidth }\"\n [alt]=\"imageEntry.name\"\n [thySrc]=\"imageEntry.thumbUrl\"\n [thyPreviewSrc]=\"imageEntry.thumbUrl\"\n [thyOriginSrc]=\"imageEntry.originUrl\"\n [thyDisablePreview]=\"disablePreview\"\n [thyImageMeta]=\"{ name: imageEntry.name, size: imageEntry.size }\"\n (load)=\"imageLoaded($event)\"\n (mousedown)=\"preventDefault($event)\"\n (error)=\"imageError($event)\"\n (click)=\"imageClick($event)\"\n />\n <div *ngIf=\"isCollapsedAndNonReadonly\" class=\"image-profile\" [class.outline]=\"selection\">\n <ng-container *ngIf=\"!loadImageError\">\n <span (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left bottom\"></span>\n </ng-container>\n </div>\n <ng-template [ngTemplateOutlet]=\"imageUploading\"></ng-template>\n <div *ngIf=\"!uploading\" class=\"layer\" [class.readonly]=\"readonly\"></div>\n </div>\n</div>\n\n<ng-template #imageLoading>\n <div *ngIf=\"!imageEntry.thumbUrl\" class=\"image-loading cursor-pointer\" contenteditable=\"false\">\n <thy-icon thyIconName=\"image\"></thy-icon>\n </div>\n\n <ng-template [ngTemplateOutlet]=\"imageUploading\"></ng-template>\n</ng-template>\n\n<ng-template #layoutToolbar>\n <thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of layoutOptions\">\n <a\n *ngIf=\"item.key !== 'split'\"\n href=\"javascript:;\"\n thyAction\n [thyType]=\"item.key === 'remove' ? 'danger' : 'primary'\"\n [thyActionIcon]=\"item.icon\"\n [thyActionActive]=\"layoutActive(item.key)\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"item?.handle($event, item.key)\"\n ></a>\n <thy-divider *ngIf=\"item.key === 'split'\" class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\" thyColor=\"light\"></thy-divider>\n </ng-container>\n </thy-actions>\n</ng-template>\n\n<ng-template #imageUploading>\n <div *ngIf=\"uploading\" class=\"uploading\">\n <div class=\"uploading-percentage\">\n <thy-progress thyType=\"primary\" [thyValue]=\"percentage\" thySize=\"sm\"></thy-progress>\n <thy-icon (click)=\"cancelUpload($event)\" thyIconName=\"close-circle-bold-fill\" thyIconLegging=\"true\"> </thy-icon>\n </div>\n </div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: i2$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i1$1.SlateChildren, selector: "slate-children", inputs: ["children", "context", "viewContext"] }, { kind: "component", type: i4.ThyIconComponent, selector: "thy-icon, [thy-icon]", inputs: ["thyIconType", "thyTwotoneColor", "thyIconName", "thyIconRotate", "thyIconSet", "thyIconLegging", "thyIconLinearGradient"] }, { kind: "directive", type: i8.ThyTooltipDirective, selector: "[thyTooltip],[thy-tooltip]", inputs: ["thyTooltip", "thyTooltipPlacement", "thyTooltipClass", "thyTooltipShowDelay", "thyTooltipHideDelay", "thyTooltipTrigger", "thyTooltipDisabled", "thyTooltipTemplateContext", "thyTooltipOffset", "thyTooltipPin"], exportAs: ["thyTooltip"] }, { kind: "component", type: i9$1.ThyProgressComponent, selector: "thy-progress", inputs: ["thyType", "thySize", "thyValue", "thyMax", "thyTips", "thyShape", "thyGapDegree", "thyGapPosition", "thyStrokeWidth"] }, { kind: "directive", type: i1$4.ThyImageDirective, selector: "img[thyImage]", inputs: ["thySrc", "thyPreviewSrc", "thyOriginSrc", "thyImageMeta", "thyDisablePreview", "thyResolveSize"], exportAs: ["thyImage"] }, { kind: "component", type: i7.ThyActionComponent, selector: "thy-action, [thyAction]", inputs: ["thyType", "thyIcon", "thyActionIcon", "thyActive", "thyActionActive", "thyTheme", "thyHoverIcon", "thyDisabled"] }, { kind: "component", type: i7.ThyActionsComponent, selector: "thy-actions", inputs: ["thySize"] }, { kind: "component", type: i8$1.ThyDividerComponent, selector: "thy-divider", inputs: ["thyVertical", "thyStyle", "thyColor", "thyText", "thyTextDirection", "thyDeeper"] }] }); }
9524
9545
  }
9525
9546
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TheImageComponent, decorators: [{
9526
9547
  type: Component,
9527
- args: [{ selector: 'the-image, [theImage]', template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div #imageContent *ngIf=\"imageEntry.thumbUrl\" class=\"image-content\" [class.cursor-pointer]=\"!selection\">\n <img\n #img\n thyImage\n class=\"main-image\"\n [class.image-collapsed]=\"selection && !uploading\"\n [ngStyle]=\"{ 'width.px': imageBindingWidth }\"\n [alt]=\"imageEntry.name\"\n [thySrc]=\"imageEntry.thumbUrl\"\n [thyPreviewSrc]=\"imageEntry.thumbUrl\"\n [thyOriginSrc]=\"imageEntry.originUrl\"\n [thyDisablePreview]=\"disablePreview\"\n [thyImageMeta]=\"{ name: imageEntry.name, size: imageEntry.size }\"\n (load)=\"imageLoaded($event)\"\n (mousedown)=\"preventDefault($event)\"\n (error)=\"imageError($event)\"\n (click)=\"imageClick($event)\"\n />\n <div *ngIf=\"isCollapsedAndNonReadonly\" class=\"image-profile\" [class.outline]=\"selection\">\n <ng-container *ngIf=\"!loadImageError\">\n <span (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left bottom\"></span>\n </ng-container>\n </div>\n <div *ngIf=\"uploading\" class=\"uploading\">\n <div class=\"uploading-percentage\">\n <thy-progress thyType=\"primary\" [thyValue]=\"percentage\" thySize=\"sm\"></thy-progress>\n <thy-icon (click)=\"cancelUpload($event)\" thyIconName=\"close-circle-bold-fill\" thyIconLegging=\"true\"> </thy-icon>\n </div>\n </div>\n <div *ngIf=\"!uploading\" class=\"layer\" [class.readonly]=\"readonly\"></div>\n </div>\n <div *ngIf=\"!imageEntry.thumbUrl\" class=\"image-loading cursor-pointer\" contenteditable=\"false\">\n <thy-icon thyIconName=\"image\"></thy-icon>\n </div>\n</div>\n\n<ng-template #layoutToolbar>\n <thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of layoutOptions\">\n <a\n *ngIf=\"item.key !== 'split'\"\n href=\"javascript:;\"\n thyAction\n [thyType]=\"item.key === 'remove' ? 'danger' : 'primary'\"\n [thyActionIcon]=\"item.icon\"\n [thyActionActive]=\"layoutActive(item.key)\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"item?.handle($event, item.key)\"\n ></a>\n <thy-divider *ngIf=\"item.key === 'split'\" class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\" thyColor=\"light\"></thy-divider>\n </ng-container>\n </thy-actions>\n</ng-template>\n" }]
9528
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: undefined, decorators: [{
9548
+ args: [{ selector: 'the-image, [theImage]', template: "<slate-children [children]=\"children\" [context]=\"childrenContext\" [viewContext]=\"viewContext\"></slate-children>\n\n<div class=\"image-container\" contenteditable=\"false\" [style.textAlign]=\"imageEntry.align\">\n <div #imageContent *ngIf=\"imageEntry.thumbUrl; else imageLoading\" class=\"image-content\" [class.cursor-pointer]=\"!selection\">\n <img\n #img\n thyImage\n class=\"main-image\"\n [class.image-collapsed]=\"selection && !uploading\"\n [ngStyle]=\"{ 'width.px': imageBindingWidth }\"\n [alt]=\"imageEntry.name\"\n [thySrc]=\"imageEntry.thumbUrl\"\n [thyPreviewSrc]=\"imageEntry.thumbUrl\"\n [thyOriginSrc]=\"imageEntry.originUrl\"\n [thyDisablePreview]=\"disablePreview\"\n [thyImageMeta]=\"{ name: imageEntry.name, size: imageEntry.size }\"\n (load)=\"imageLoaded($event)\"\n (mousedown)=\"preventDefault($event)\"\n (error)=\"imageError($event)\"\n (click)=\"imageClick($event)\"\n />\n <div *ngIf=\"isCollapsedAndNonReadonly\" class=\"image-profile\" [class.outline]=\"selection\">\n <ng-container *ngIf=\"!loadImageError\">\n <span (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left top\"></span>\n <span (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right top\"></span>\n <span (mousedown)=\"startDrag($event, 'xl')\" class=\"image-pointer right bottom\"></span>\n <span (mousedown)=\"startDrag($event, '-xl')\" class=\"image-pointer left bottom\"></span>\n </ng-container>\n </div>\n <ng-template [ngTemplateOutlet]=\"imageUploading\"></ng-template>\n <div *ngIf=\"!uploading\" class=\"layer\" [class.readonly]=\"readonly\"></div>\n </div>\n</div>\n\n<ng-template #imageLoading>\n <div *ngIf=\"!imageEntry.thumbUrl\" class=\"image-loading cursor-pointer\" contenteditable=\"false\">\n <thy-icon thyIconName=\"image\"></thy-icon>\n </div>\n\n <ng-template [ngTemplateOutlet]=\"imageUploading\"></ng-template>\n</ng-template>\n\n<ng-template #layoutToolbar>\n <thy-actions thySize=\"xxs\">\n <ng-container *ngFor=\"let item of layoutOptions\">\n <a\n *ngIf=\"item.key !== 'split'\"\n href=\"javascript:;\"\n thyAction\n [thyType]=\"item.key === 'remove' ? 'danger' : 'primary'\"\n [thyActionIcon]=\"item.icon\"\n [thyActionActive]=\"layoutActive(item.key)\"\n [thyTooltip]=\"item.name\"\n thyTooltipPlacement=\"top\"\n (mousedown)=\"item?.handle($event, item.key)\"\n ></a>\n <thy-divider *ngIf=\"item.key === 'split'\" class=\"mr-2 ml-1 align-self-center\" [thyVertical]=\"true\" thyColor=\"light\"></thy-divider>\n </ng-container>\n </thy-actions>\n</ng-template>\n\n<ng-template #imageUploading>\n <div *ngIf=\"uploading\" class=\"uploading\">\n <div class=\"uploading-percentage\">\n <thy-progress thyType=\"primary\" [thyValue]=\"percentage\" thySize=\"sm\"></thy-progress>\n <thy-icon (click)=\"cancelUpload($event)\" thyIconName=\"close-circle-bold-fill\" thyIconLegging=\"true\"> </thy-icon>\n </div>\n </div>\n</ng-template>\n" }]
9549
+ }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1$4.ThyImageGroupComponent }, { type: undefined, decorators: [{
9529
9550
  type: Inject,
9530
9551
  args: [THE_UPLOAD_SERVICE_TOKEN]
9531
- }] }, { type: i0.ChangeDetectorRef }, { type: TheContextService }, { type: i1.ThyPopover }, { type: i2.Overlay }, { type: i0.ViewContainerRef }, { type: i4$1.ThyImageGroupComponent }]; }, propDecorators: { imageContent: [{
9552
+ }] }, { type: TheContextService }, { type: i1.ThyPopover }, { type: i2.Overlay }, { type: i0.ViewContainerRef }, { type: i0.DestroyRef }]; }, propDecorators: { imageContent: [{
9532
9553
  type: ViewChild,
9533
9554
  args: ['imageContent']
9534
9555
  }], img: [{
@@ -16680,7 +16701,7 @@ class TheEditorComponent {
16680
16701
  useExisting: forwardRef(() => TheEditorComponent),
16681
16702
  multi: true
16682
16703
  }
16683
- ], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "theEditableContainer", first: true, predicate: ["theEditableContainer"], descendants: true, read: ElementRef, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<the-toolbar\n *ngIf=\"!options?.readonly && !theGlobalToolbar && !isMobileMode\"\n [ngClass]=\"{\n 'the-toolbar-disabled': options?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"options?.toolbar?.align\"\n></the-toolbar>\n\n<div\n #theEditableContainer\n class=\"the-editable-container\"\n thyImageGroup\n [ngClass]=\"{\n 'the-editor-disabled': options?.disabled,\n 'max-height': maxHeight\n }\"\n [ngStyle]=\"{ 'max-height': maxHeight }\"\n>\n <slate-editable\n class=\"the-editor-typo\"\n [editor]=\"editor\"\n [ngModel]=\"editorValue\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [isStrictDecorate]=\"false\"\n [decorate]=\"decorate\"\n [placeholder]=\"options?.placeholder\"\n [placeholderDecorate]=\"options?.placeholderDecorate ? options?.placeholderDecorate : null\"\n [readonly]=\"options?.readonly || options?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [beforeInput]=\"onSlaBeforeInput\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n [scrollSelectionIntoView]=\"scrollSelectionIntoView\"\n (ngModelChange)=\"valueChange($event)\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n\n <ng-container *ngIf=\"!isMobileMode\">\n <the-inline-toolbar\n *ngIf=\"!options?.readonly && options?.inlineToolbarVisible\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.inline\"\n ></the-inline-toolbar>\n <div *ngIf=\"!options?.readonly\" theQuickInsert [editor]=\"editor\" [isVisible]=\"visibleQuickInsertPlus\"></div>\n </ng-container>\n\n <the-template #templateInstance></the-template>\n</div>\n", dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i1$1.SlateEditable, selector: "slate-editable", inputs: ["editor", "renderElement", "renderLeaf", "renderText", "decorate", "placeholderDecorate", "scrollSelectionIntoView", "isStrictDecorate", "trackBy", "readonly", "placeholder", "beforeInput", "blur", "click", "compositionEnd", "compositionUpdate", "compositionStart", "copy", "cut", "dragOver", "dragStart", "dragEnd", "drop", "focus", "keydown", "paste", "spellCheck", "autoCorrect", "autoCapitalize"] }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4$1.ThyImageGroupComponent, selector: "thy-image-group, [thyImageGroup]" }, { kind: "component", type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }, { kind: "component", type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: ["editor", "toolbarItems"] }, { kind: "component", type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: ["editor", "isVisible"] }, { kind: "component", type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
16704
+ ], viewQueries: [{ propertyName: "templateInstance", first: true, predicate: ["templateInstance"], descendants: true, static: true }, { propertyName: "theEditableContainer", first: true, predicate: ["theEditableContainer"], descendants: true, read: ElementRef, static: true }, { propertyName: "globalToolbarInstance", first: true, predicate: ["globalToolbar"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<the-toolbar\n *ngIf=\"!options?.readonly && !theGlobalToolbar && !isMobileMode\"\n [ngClass]=\"{\n 'the-toolbar-disabled': options?.disabled\n }\"\n #globalToolbar\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.global\"\n [containerClass]=\"globalToolbarClass\"\n [align]=\"options?.toolbar?.align\"\n></the-toolbar>\n\n<div\n #theEditableContainer\n class=\"the-editable-container\"\n thyImageGroup\n [ngClass]=\"{\n 'the-editor-disabled': options?.disabled,\n 'max-height': maxHeight\n }\"\n [ngStyle]=\"{ 'max-height': maxHeight }\"\n>\n <slate-editable\n class=\"the-editor-typo\"\n [editor]=\"editor\"\n [ngModel]=\"editorValue\"\n [renderElement]=\"renderElement\"\n [renderText]=\"renderText\"\n [renderLeaf]=\"renderLeaf\"\n [isStrictDecorate]=\"false\"\n [decorate]=\"decorate\"\n [placeholder]=\"options?.placeholder\"\n [placeholderDecorate]=\"options?.placeholderDecorate ? options?.placeholderDecorate : null\"\n [readonly]=\"options?.readonly || options?.disabled\"\n [keydown]=\"onKeyDown\"\n [click]=\"onClick\"\n [paste]=\"onSlaPaste\"\n [blur]=\"onSlaBlur\"\n [focus]=\"onSlaFocus\"\n [copy]=\"onSlaCopy\"\n [cut]=\"onSlaCut\"\n [beforeInput]=\"onSlaBeforeInput\"\n [compositionStart]=\"onSlaCompositionStart\"\n [compositionEnd]=\"onSlaCompositionEnd\"\n [dragStart]=\"onSlaDragStart\"\n [dragOver]=\"onSlaDragOver\"\n [drop]=\"onDrop\"\n [scrollSelectionIntoView]=\"scrollSelectionIntoView\"\n (ngModelChange)=\"valueChange($event)\"\n (mousedown)=\"mousedown($event)\"\n ></slate-editable>\n\n <ng-container *ngIf=\"!isMobileMode\">\n <the-inline-toolbar\n *ngIf=\"!options?.readonly && options?.inlineToolbarVisible\"\n [editor]=\"editor\"\n [toolbarItems]=\"toolbarEntity.inline\"\n ></the-inline-toolbar>\n <div *ngIf=\"!options?.readonly\" theQuickInsert [editor]=\"editor\" [isVisible]=\"visibleQuickInsertPlus\"></div>\n </ng-container>\n\n <the-template #templateInstance></the-template>\n</div>\n", dependencies: [{ kind: "directive", type: i2$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i2$1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "component", type: i1$1.SlateEditable, selector: "slate-editable", inputs: ["editor", "renderElement", "renderLeaf", "renderText", "decorate", "placeholderDecorate", "scrollSelectionIntoView", "isStrictDecorate", "trackBy", "readonly", "placeholder", "beforeInput", "blur", "click", "compositionEnd", "compositionUpdate", "compositionStart", "copy", "cut", "dragOver", "dragStart", "dragEnd", "drop", "focus", "keydown", "paste", "spellCheck", "autoCorrect", "autoCapitalize"] }, { kind: "directive", type: i2$2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1$4.ThyImageGroupComponent, selector: "thy-image-group, [thyImageGroup]" }, { kind: "component", type: TheToolbarComponent, selector: "the-toolbar", inputs: ["editor", "toolbarItems", "align", "containerClass", "isMore", "afterTemplate"] }, { kind: "component", type: TheInlineToolbarComponent, selector: "the-inline-toolbar", inputs: ["editor", "toolbarItems"] }, { kind: "component", type: TheQuickInsertComponent, selector: "[theQuickInsert]", inputs: ["editor", "isVisible"] }, { kind: "component", type: TheTemplateComponent, selector: "the-template,[theTemplate]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
16684
16705
  }
16685
16706
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TheEditorComponent, decorators: [{
16686
16707
  type: Component,