@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.
- package/custom-types.d.ts +1 -1
- package/editor.module.d.ts +2 -2
- package/esm2022/custom-types.mjs +1 -1
- package/esm2022/interfaces/image.mjs +1 -1
- package/esm2022/interfaces/index.mjs +2 -1
- package/esm2022/interfaces/upload.mjs +1 -1
- package/esm2022/plugins/deserialize/deserialize-html.plugin.mjs +2 -2
- package/esm2022/plugins/deserialize/deserialize-md.plugin.mjs +2 -2
- package/esm2022/plugins/image/image.component.mjs +90 -73
- package/esm2022/plugins/image/image.editor.mjs +19 -16
- package/esm2022/plugins/mention/mention.editor.mjs +2 -2
- package/esm2022/services/context.service.mjs +4 -1
- package/esm2022/utils/data-transform.mjs +1 -1
- package/fesm2022/worktile-theia.mjs +109 -88
- package/fesm2022/worktile-theia.mjs.map +1 -1
- package/interfaces/editor.d.ts +2 -2
- package/interfaces/image.d.ts +2 -2
- package/interfaces/index.d.ts +1 -0
- package/interfaces/upload.d.ts +3 -0
- package/package.json +1 -1
- package/plugins/image/image.component.d.ts +15 -10
- package/plugins/image/image.editor.d.ts +1 -6
- package/plugins/table/utils/is-virtual-key.d.ts +1 -1
- package/services/context.service.d.ts +3 -3
package/interfaces/editor.d.ts
CHANGED
|
@@ -44,7 +44,7 @@ export declare const TheEditor: {
|
|
|
44
44
|
insertTextData(editor: AngularEditor, data: DataTransfer): boolean;
|
|
45
45
|
onKeydown(editor: AngularEditor, data: KeyboardEvent): void;
|
|
46
46
|
onClick(editor: AngularEditor, data: MouseEvent): void;
|
|
47
|
-
setFragmentData(editor: AngularEditor, data: DataTransfer, originEvent?: "
|
|
47
|
+
setFragmentData(editor: AngularEditor, data: DataTransfer, originEvent?: "copy" | "drag" | "cut"): void;
|
|
48
48
|
deleteCutData(editor: AngularEditor): void;
|
|
49
49
|
toDOMNode(editor: AngularEditor, node: Node): HTMLElement;
|
|
50
50
|
toDOMPoint(editor: AngularEditor, point: import("slate").BasePoint): import("slate-angular").DOMPoint;
|
|
@@ -53,7 +53,7 @@ export declare const TheEditor: {
|
|
|
53
53
|
findEventRange(editor: AngularEditor, event: any): import("slate").BaseRange;
|
|
54
54
|
isLeafInEditor(editor: AngularEditor, leafNode: globalThis.Element): boolean;
|
|
55
55
|
toSlatePoint(editor: AngularEditor, domPoint: import("slate-angular").DOMPoint): import("slate").BasePoint;
|
|
56
|
-
toSlateRange(editor: AngularEditor, domRange: globalThis.Range | StaticRange
|
|
56
|
+
toSlateRange(editor: AngularEditor, domRange: Selection | globalThis.Range | StaticRange): import("slate").BaseRange;
|
|
57
57
|
isLeafBlock(editor: AngularEditor, node: Node): boolean;
|
|
58
58
|
isBlockCardLeftCursor(editor: AngularEditor): boolean;
|
|
59
59
|
isBlockCardRightCursor(editor: AngularEditor): boolean;
|
package/interfaces/image.d.ts
CHANGED
|
@@ -28,10 +28,10 @@ export interface LayoutOption extends ToolbarItem {
|
|
|
28
28
|
handle?: (e: MouseEvent, key: Alignment | LayoutTypes) => void;
|
|
29
29
|
}
|
|
30
30
|
export interface TheImageUploaderService {
|
|
31
|
-
uploadFileHandle: (files:
|
|
31
|
+
uploadFileHandle: (files: File | string) => Observable<UploadFileEntity[]>;
|
|
32
32
|
getUploadingItems$: () => Observable<FileUploadingItem[]>;
|
|
33
33
|
buildImageUrl?: (imageUrl: string) => string;
|
|
34
|
-
|
|
34
|
+
isExternalUrl?: (imageUrl: string) => boolean;
|
|
35
35
|
}
|
|
36
36
|
export declare const THE_UPLOAD_SERVICE_TOKEN: InjectionToken<TheImageUploaderService>;
|
|
37
37
|
export interface ImagePluginOptions {
|
package/interfaces/index.d.ts
CHANGED
package/interfaces/upload.d.ts
CHANGED
|
@@ -2,10 +2,13 @@ import { ThyUploadResponse } from 'ngx-tethys/upload';
|
|
|
2
2
|
export interface UploadFileEntity {
|
|
3
3
|
thumbUrl: string;
|
|
4
4
|
originUrl: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
size?: number;
|
|
5
7
|
}
|
|
6
8
|
export interface FileUploadingItem {
|
|
7
9
|
scopeId?: string;
|
|
8
10
|
file: File;
|
|
11
|
+
url?: string;
|
|
9
12
|
started?: boolean;
|
|
10
13
|
result?: ThyUploadResponse;
|
|
11
14
|
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Overlay } from '@angular/cdk/overlay';
|
|
2
|
-
import { AfterViewInit, ChangeDetectorRef, ElementRef, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { AfterViewInit, ChangeDetectorRef, DestroyRef, ElementRef, OnDestroy, OnInit, TemplateRef, ViewContainerRef } from '@angular/core';
|
|
3
3
|
import { ThyImageDirective, ThyImageGroupComponent } from 'ngx-tethys/image';
|
|
4
4
|
import { ThyPopover } from 'ngx-tethys/popover';
|
|
5
5
|
import { Editor } from 'slate';
|
|
@@ -12,13 +12,14 @@ import { TheContextService } from '../../services/context.service';
|
|
|
12
12
|
import * as i0 from "@angular/core";
|
|
13
13
|
export declare class TheImageComponent extends TheBaseElementComponent<ImageElement, Editor> implements OnInit, OnDestroy, AfterViewInit, BeforeContextChange<SlateElementContext> {
|
|
14
14
|
elementRef: ElementRef;
|
|
15
|
-
private imageUploaderService;
|
|
16
15
|
cdr: ChangeDetectorRef;
|
|
16
|
+
imageGroupComponent: ThyImageGroupComponent;
|
|
17
|
+
private imageUploaderService;
|
|
17
18
|
private theContextService;
|
|
18
19
|
private thyPopover;
|
|
19
20
|
private overlay;
|
|
20
21
|
private viewContainerRef;
|
|
21
|
-
|
|
22
|
+
private destroyRef;
|
|
22
23
|
naturalWidth: number;
|
|
23
24
|
naturalHeight: number;
|
|
24
25
|
imageEntry: ImageEntry;
|
|
@@ -26,7 +27,7 @@ export declare class TheImageComponent extends TheBaseElementComponent<ImageElem
|
|
|
26
27
|
percentage: number;
|
|
27
28
|
fileItem: {
|
|
28
29
|
url: string;
|
|
29
|
-
file: File;
|
|
30
|
+
file: File | string;
|
|
30
31
|
};
|
|
31
32
|
layoutDefaultWidth: number;
|
|
32
33
|
disablePreview: boolean;
|
|
@@ -34,7 +35,6 @@ export declare class TheImageComponent extends TheBaseElementComponent<ImageElem
|
|
|
34
35
|
layoutOptions: LayoutOption[];
|
|
35
36
|
private uploadingSubscription;
|
|
36
37
|
private mouseMoveSubscription;
|
|
37
|
-
private mouseUpSubscription;
|
|
38
38
|
private dragable;
|
|
39
39
|
private layoutToolbarRef;
|
|
40
40
|
private imagePluginOptions;
|
|
@@ -44,15 +44,19 @@ export declare class TheImageComponent extends TheBaseElementComponent<ImageElem
|
|
|
44
44
|
img: ElementRef;
|
|
45
45
|
layoutToolbar: TemplateRef<any>;
|
|
46
46
|
imageDirective: ThyImageDirective;
|
|
47
|
-
constructor(elementRef: ElementRef,
|
|
47
|
+
constructor(elementRef: ElementRef, cdr: ChangeDetectorRef, imageGroupComponent: ThyImageGroupComponent, imageUploaderService: TheImageUploaderService, theContextService: TheContextService, thyPopover: ThyPopover, overlay: Overlay, viewContainerRef: ViewContainerRef, destroyRef: DestroyRef);
|
|
48
48
|
beforeContextChange: (value: SlateElementContext<ImageElement>) => void;
|
|
49
49
|
ngOnInit(): void;
|
|
50
|
-
|
|
50
|
+
ngAfterViewInit(): void;
|
|
51
51
|
onContextChange(): void;
|
|
52
52
|
ngOnDestroy(): void;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
private setImagePluginOptions;
|
|
54
|
+
private setDisablePreview;
|
|
55
|
+
private setImageFileItem;
|
|
56
|
+
private subscribeMouseUp;
|
|
57
|
+
private subscribeImageUploadingState;
|
|
58
|
+
private setImageNodes;
|
|
59
|
+
uploadImage(): Promise<void>;
|
|
56
60
|
startDrag(event: MouseEvent, axis: string): void;
|
|
57
61
|
mouseMoveHandle(event: MouseEvent, options: {
|
|
58
62
|
axis: string;
|
|
@@ -76,6 +80,7 @@ export declare class TheImageComponent extends TheBaseElementComponent<ImageElem
|
|
|
76
80
|
imageLoaded(event: Event): void;
|
|
77
81
|
imageError(event: Event): void;
|
|
78
82
|
preventDefault(event: Event): void;
|
|
83
|
+
imageClick(): void;
|
|
79
84
|
static ɵfac: i0.ɵɵFactoryDeclaration<TheImageComponent, never>;
|
|
80
85
|
static ɵcmp: i0.ɵɵComponentDeclaration<TheImageComponent, "the-image, [theImage]", never, {}, {}, never, never, false, never>;
|
|
81
86
|
}
|
|
@@ -4,15 +4,10 @@ export declare const ImageEditor: {
|
|
|
4
4
|
openUpload(editor: Editor): void;
|
|
5
5
|
insertImages(editor: Editor, imageFiles: FileList | File[]): void;
|
|
6
6
|
handleBase64ImageElement(editor: Editor, image: ImageElement): void;
|
|
7
|
+
handleExternalImageElement(editor: Editor, image: ImageElement): void;
|
|
7
8
|
verifyImage(editor: Editor, image: File): boolean;
|
|
8
9
|
isActive(editor: Editor): boolean;
|
|
9
10
|
setImageNode(editor: Editor, props: Partial<ImageElement>, image?: ImageElement): void;
|
|
10
11
|
isBase64(url: string): boolean;
|
|
11
|
-
/**
|
|
12
|
-
* 设置图片来源
|
|
13
|
-
* @param editor 编辑器对象
|
|
14
|
-
* @param image 图片节点
|
|
15
|
-
*/
|
|
16
|
-
setImageSource(editor: Editor, image: ImageElement): void;
|
|
17
12
|
removeImage(editor: Editor, image?: ImageElement): void;
|
|
18
13
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function isVirtualKey(e: KeyboardEvent):
|
|
1
|
+
export declare function isVirtualKey(e: KeyboardEvent): any;
|
|
@@ -22,7 +22,7 @@ export declare class TheContextService implements OnDestroy {
|
|
|
22
22
|
private options;
|
|
23
23
|
uploadingFiles: {
|
|
24
24
|
url: string;
|
|
25
|
-
file: File;
|
|
25
|
+
file: File | string;
|
|
26
26
|
}[];
|
|
27
27
|
paintFormatStatus: PaintFormatStatus;
|
|
28
28
|
onMouseUp$: Observable<MouseEvent>;
|
|
@@ -65,11 +65,11 @@ export declare class TheContextService implements OnDestroy {
|
|
|
65
65
|
getFirstElementChild(): HTMLElement;
|
|
66
66
|
addUploadingFiles(file: {
|
|
67
67
|
url: string;
|
|
68
|
-
file: File;
|
|
68
|
+
file: File | string;
|
|
69
69
|
}): void;
|
|
70
70
|
removeUploadFile(file: {
|
|
71
71
|
url: string;
|
|
72
|
-
file: File;
|
|
72
|
+
file: File | string;
|
|
73
73
|
}): void;
|
|
74
74
|
ngOnDestroy(): void;
|
|
75
75
|
static ɵfac: i0.ɵɵFactoryDeclaration<TheContextService, never>;
|