@worktile/theia 3.0.7 → 3.0.8
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/bundles/worktile-theia.umd.js +33 -16
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/editor.component.d.ts +2 -1
- package/esm2015/editor.component.js +15 -2
- package/esm2015/plugins/image/image.component.js +12 -8
- package/esm2015/plugins/image/image.editor.js +3 -5
- package/esm2015/services/context.service.js +7 -6
- package/fesm2015/worktile-theia.js +33 -17
- package/fesm2015/worktile-theia.js.map +1 -1
- package/package.json +1 -1
- package/plugins/image/image.component.d.ts +4 -1
- package/services/context.service.d.ts +8 -4
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { Injectable } from '@angular/core';
|
|
2
|
-
import { fromEvent } from 'rxjs';
|
|
2
|
+
import { fromEvent, Subject } from 'rxjs';
|
|
3
3
|
import { FontSizes } from '../constants/node-types';
|
|
4
4
|
import * as i0 from "@angular/core";
|
|
5
5
|
export class TheContextService {
|
|
6
6
|
constructor(ngZone) {
|
|
7
7
|
this.ngZone = ngZone;
|
|
8
|
-
this.
|
|
8
|
+
this.uploadingFiles = [];
|
|
9
9
|
this.paintFormatStatus = {
|
|
10
10
|
isActive: false,
|
|
11
11
|
marks: {}
|
|
12
12
|
};
|
|
13
|
+
this.uploadingStatus$ = new Subject();
|
|
13
14
|
this.ngZone.runOutsideAngular(() => {
|
|
14
15
|
this.onMouseUp$ = fromEvent(window, `mouseup`);
|
|
15
16
|
this.onMouseMove$ = fromEvent(window, `mousemove`);
|
|
@@ -44,11 +45,11 @@ export class TheContextService {
|
|
|
44
45
|
const firstElementChild = this.getFirstElementChild();
|
|
45
46
|
return 0.48 * firstElementChild.clientWidth;
|
|
46
47
|
}
|
|
47
|
-
|
|
48
|
-
this.
|
|
48
|
+
addUploadingFiles(file) {
|
|
49
|
+
this.uploadingFiles.push(file);
|
|
49
50
|
}
|
|
50
51
|
removeUploadImage(file) {
|
|
51
|
-
this.
|
|
52
|
+
this.uploadingFiles.splice(this.uploadingFiles.findIndex(item => item.url === file.url), 1);
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
TheContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheContextService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -56,4 +57,4 @@ TheContextService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", ve
|
|
|
56
57
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheContextService, decorators: [{
|
|
57
58
|
type: Injectable
|
|
58
59
|
}], ctorParameters: function () { return [{ type: i0.NgZone }]; } });
|
|
59
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
60
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udGV4dC5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vcGFja2FnZXMvc3JjL3NlcnZpY2VzL2NvbnRleHQuc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsVUFBVSxFQUE0QixNQUFNLGVBQWUsQ0FBQztBQUNyRSxPQUFPLEVBQUUsU0FBUyxFQUFjLE9BQU8sRUFBRSxNQUFNLE1BQU0sQ0FBQztBQUV0RCxPQUFPLEVBQUUsU0FBUyxFQUFhLE1BQU0seUJBQXlCLENBQUM7O0FBZS9ELE1BQU0sT0FBTyxpQkFBaUI7SUFrQjFCLFlBQW9CLE1BQWM7UUFBZCxXQUFNLEdBQU4sTUFBTSxDQUFRO1FBZmxDLG1CQUFjLEdBQWtDLEVBQUUsQ0FBQztRQUU1QyxzQkFBaUIsR0FBc0I7WUFDMUMsUUFBUSxFQUFFLEtBQUs7WUFDZixLQUFLLEVBQU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KTtcbiAgICB9XG59XG4iXX0=
|
|
@@ -10,7 +10,7 @@ import { mixinUnsubscribe, MixinBase } from 'ngx-tethys/core';
|
|
|
10
10
|
import isHotkey, { isKeyHotkey } from 'is-hotkey';
|
|
11
11
|
import { Range, Node, Element as Element$1, Text, Editor, Transforms, Span, Path, Point, Operation, createEditor } from 'slate';
|
|
12
12
|
import { HistoryEditor, withHistory } from 'slate-history';
|
|
13
|
-
import { fromEvent, timer,
|
|
13
|
+
import { Subject, fromEvent, timer, combineLatest, Observable, BehaviorSubject, merge, ReplaySubject } from 'rxjs';
|
|
14
14
|
import * as i1$1 from 'ngx-tethys/popover';
|
|
15
15
|
import { ThyPopover } from 'ngx-tethys/popover';
|
|
16
16
|
import * as i3 from 'ngx-tethys/icon';
|
|
@@ -572,11 +572,12 @@ var PluginKeys;
|
|
|
572
572
|
class TheContextService {
|
|
573
573
|
constructor(ngZone) {
|
|
574
574
|
this.ngZone = ngZone;
|
|
575
|
-
this.
|
|
575
|
+
this.uploadingFiles = [];
|
|
576
576
|
this.paintFormatStatus = {
|
|
577
577
|
isActive: false,
|
|
578
578
|
marks: {}
|
|
579
579
|
};
|
|
580
|
+
this.uploadingStatus$ = new Subject();
|
|
580
581
|
this.ngZone.runOutsideAngular(() => {
|
|
581
582
|
this.onMouseUp$ = fromEvent(window, `mouseup`);
|
|
582
583
|
this.onMouseMove$ = fromEvent(window, `mousemove`);
|
|
@@ -611,11 +612,11 @@ class TheContextService {
|
|
|
611
612
|
const firstElementChild = this.getFirstElementChild();
|
|
612
613
|
return 0.48 * firstElementChild.clientWidth;
|
|
613
614
|
}
|
|
614
|
-
|
|
615
|
-
this.
|
|
615
|
+
addUploadingFiles(file) {
|
|
616
|
+
this.uploadingFiles.push(file);
|
|
616
617
|
}
|
|
617
618
|
removeUploadImage(file) {
|
|
618
|
-
this.
|
|
619
|
+
this.uploadingFiles.splice(this.uploadingFiles.findIndex(item => item.url === file.url), 1);
|
|
619
620
|
}
|
|
620
621
|
}
|
|
621
622
|
TheContextService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheContextService, deps: [{ token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -2674,6 +2675,7 @@ const ImageEditor = {
|
|
|
2674
2675
|
const inputFile = document.createElement('input');
|
|
2675
2676
|
inputFile.setAttribute('type', 'file');
|
|
2676
2677
|
inputFile.setAttribute('accept', 'image/*');
|
|
2678
|
+
inputFile.setAttribute('multiple', 'true');
|
|
2677
2679
|
inputFile.onchange = (event) => {
|
|
2678
2680
|
ImageEditor.insertImages(editor, event.target.files);
|
|
2679
2681
|
};
|
|
@@ -2687,10 +2689,7 @@ const ImageEditor = {
|
|
|
2687
2689
|
const verify = ImageEditor.verifyImage(editor, image);
|
|
2688
2690
|
if (verify) {
|
|
2689
2691
|
const url = URL.createObjectURL(image);
|
|
2690
|
-
contextService.
|
|
2691
|
-
url,
|
|
2692
|
-
file: image
|
|
2693
|
-
});
|
|
2692
|
+
contextService.addUploadingFiles({ url, file: image });
|
|
2694
2693
|
imageNodes.push({ type: ElementKinds.image, url, children: [text] });
|
|
2695
2694
|
}
|
|
2696
2695
|
}
|
|
@@ -2838,9 +2837,9 @@ class TheImageComponent extends TheBaseElementComponent {
|
|
|
2838
2837
|
ngOnInit() {
|
|
2839
2838
|
var _a;
|
|
2840
2839
|
this.layoutDefaultWidth = this.theContextService.layoutDefaultWidth();
|
|
2841
|
-
this.
|
|
2842
|
-
if (this.file && this.file instanceof File) {
|
|
2843
|
-
this.uploadImage(this.file);
|
|
2840
|
+
this.fileItem = this.theContextService.uploadingFiles.find(item => item.url === this.element.url);
|
|
2841
|
+
if (((_a = this.fileItem) === null || _a === void 0 ? void 0 : _a.file) && this.fileItem.file instanceof File) {
|
|
2842
|
+
this.uploadImage(this.fileItem.file);
|
|
2844
2843
|
}
|
|
2845
2844
|
super.ngOnInit();
|
|
2846
2845
|
}
|
|
@@ -2864,16 +2863,19 @@ class TheImageComponent extends TheBaseElementComponent {
|
|
|
2864
2863
|
this.mouseUpSubscription = this.theContextService.onMouseUp$.subscribe(e => this.endDrag(e));
|
|
2865
2864
|
this.uploadingSubscription = this.imageUploaderService
|
|
2866
2865
|
.getUploadingItems$()
|
|
2867
|
-
.pipe(map(fileUploadingItem => this.file && fileUploadingItem.find(item => item.file === this.file)))
|
|
2866
|
+
.pipe(map(fileUploadingItem => { var _a; return ((_a = this.fileItem) === null || _a === void 0 ? void 0 : _a.file) && fileUploadingItem.find(item => { var _a; return item.file === ((_a = this.fileItem) === null || _a === void 0 ? void 0 : _a.file); }); }))
|
|
2868
2867
|
.subscribe(uploadingItem => {
|
|
2869
2868
|
if (!uploadingItem || !uploadingItem.result) {
|
|
2870
2869
|
return;
|
|
2871
2870
|
}
|
|
2872
2871
|
this.percentage = uploadingItem.result.uploadFile.progress.percentage;
|
|
2873
|
-
const { status
|
|
2874
|
-
|
|
2875
|
-
|
|
2872
|
+
const { status } = uploadingItem.result;
|
|
2873
|
+
// 成功和失败都要上传结束
|
|
2874
|
+
if (status === ThyUploadStatus.done) {
|
|
2876
2875
|
this.uploadingSubscription.unsubscribe();
|
|
2876
|
+
this.uploading = false;
|
|
2877
|
+
this.theContextService.removeUploadImage(this.fileItem);
|
|
2878
|
+
this.theContextService.uploadingStatus$.next(false);
|
|
2877
2879
|
}
|
|
2878
2880
|
this.cdr.detectChanges();
|
|
2879
2881
|
});
|
|
@@ -2888,6 +2890,7 @@ class TheImageComponent extends TheBaseElementComponent {
|
|
|
2888
2890
|
thumbUrl: this.sanitizer.bypassSecurityTrustResourceUrl(URL.createObjectURL(file))
|
|
2889
2891
|
};
|
|
2890
2892
|
this.uploading = true;
|
|
2893
|
+
this.theContextService.uploadingStatus$.next(true);
|
|
2891
2894
|
const [uploadFileEntity] = yield this.imageUploaderService.uploadFileHandle([file]).toPromise();
|
|
2892
2895
|
const path = AngularEditor.findPath(this.editor, this.element);
|
|
2893
2896
|
const { thumbUrl, originUrl } = uploadFileEntity;
|
|
@@ -13063,6 +13066,7 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
13063
13066
|
this.theOnSave = new EventEmitter();
|
|
13064
13067
|
this.theOnDOMEvent = new EventEmitter();
|
|
13065
13068
|
this.theEditorCreated = new EventEmitter();
|
|
13069
|
+
this.theUploadingStatus = new EventEmitter(); // true 上传结束 false 上传中
|
|
13066
13070
|
this.autoScrollView = _.debounce(function (editor, scrollContainer) {
|
|
13067
13071
|
return autoScrollViewHandle(editor, scrollContainer);
|
|
13068
13072
|
}, 80);
|
|
@@ -13172,6 +13176,16 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
13172
13176
|
}
|
|
13173
13177
|
ngOnInit() {
|
|
13174
13178
|
this.initialize();
|
|
13179
|
+
this.theContextService.uploadingStatus$.subscribe(isUploading => {
|
|
13180
|
+
if (isUploading) {
|
|
13181
|
+
this.theUploadingStatus.emit(true);
|
|
13182
|
+
}
|
|
13183
|
+
else {
|
|
13184
|
+
if (this.theContextService.uploadingFiles.length === 0) {
|
|
13185
|
+
this.theUploadingStatus.emit(false);
|
|
13186
|
+
}
|
|
13187
|
+
}
|
|
13188
|
+
});
|
|
13175
13189
|
this.onErrorHandler();
|
|
13176
13190
|
}
|
|
13177
13191
|
ngOnChanges(changes) {
|
|
@@ -13394,7 +13408,7 @@ class TheEditorComponent extends mixinUnsubscribe(MixinBase) {
|
|
|
13394
13408
|
}
|
|
13395
13409
|
}
|
|
13396
13410
|
TheEditorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.15", ngImport: i0, type: TheEditorComponent, deps: [{ token: TheContextService }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.NgZone }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
13397
|
-
TheEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheEditorComponent, selector: "the-editor, theEditor", inputs: { theOptions: "theOptions", thePlugins: "thePlugins", theGlobalToolbar: "theGlobalToolbar", theDecorate: "theDecorate", theOnError: "theOnError" }, outputs: { theOnSave: "theOnSave", theOnDOMEvent: "theOnDOMEvent", theEditorCreated: "theEditorCreated" }, host: { properties: { "class.the-editor-readonly": "theOptions?.readonly" }, classAttribute: "the-editor" }, providers: [
|
|
13411
|
+
TheEditorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.15", type: TheEditorComponent, selector: "the-editor, theEditor", inputs: { theOptions: "theOptions", thePlugins: "thePlugins", theGlobalToolbar: "theGlobalToolbar", theDecorate: "theDecorate", theOnError: "theOnError" }, outputs: { theOnSave: "theOnSave", theOnDOMEvent: "theOnDOMEvent", theEditorCreated: "theEditorCreated", theUploadingStatus: "theUploadingStatus" }, host: { properties: { "class.the-editor-readonly": "theOptions?.readonly" }, classAttribute: "the-editor" }, providers: [
|
|
13398
13412
|
TheContextService,
|
|
13399
13413
|
TheColorSelectService,
|
|
13400
13414
|
{
|
|
@@ -13439,6 +13453,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.15", ngImpo
|
|
|
13439
13453
|
type: Output
|
|
13440
13454
|
}], theEditorCreated: [{
|
|
13441
13455
|
type: Output
|
|
13456
|
+
}], theUploadingStatus: [{
|
|
13457
|
+
type: Output
|
|
13442
13458
|
}], templateInstance: [{
|
|
13443
13459
|
type: ViewChild,
|
|
13444
13460
|
args: ['templateInstance', { static: true }]
|