@worktile/theia 16.3.3 → 16.3.4
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/editor.module.d.ts +2 -2
- package/esm2022/components/contextmenu/contextmenu.component.mjs +1 -1
- package/esm2022/plugins/code/code.component.mjs +8 -8
- package/esm2022/plugins/code/code.editor.mjs +18 -7
- package/esm2022/plugins/color/toolbar-item.component.mjs +1 -1
- package/esm2022/plugins/image/image.component.mjs +5 -8
- package/esm2022/plugins/image/image.editor.mjs +19 -4
- package/esm2022/plugins/image/image.plugin.mjs +3 -3
- package/esm2022/plugins/link/edit/link-edit.component.mjs +4 -15
- package/esm2022/plugins/link/link.component.mjs +4 -4
- package/esm2022/plugins/link/link.editor.mjs +21 -4
- package/esm2022/plugins/link/link.plugin.mjs +3 -3
- package/esm2022/plugins/public-api.mjs +2 -1
- package/esm2022/plugins/table/components/toolbar/table-toolbar.component.mjs +1 -1
- package/esm2022/plugins/table/table.editor.mjs +21 -22
- package/esm2022/plugins/table/table.plugin.mjs +2 -2
- package/esm2022/transforms/delete-node-by-type.mjs +10 -0
- package/esm2022/transforms/index.mjs +4 -2
- package/esm2022/transforms/set-node-by-type.mjs +10 -0
- package/fesm2022/worktile-theia.mjs +111 -66
- package/fesm2022/worktile-theia.mjs.map +1 -1
- package/interfaces/editor.d.ts +2 -2
- package/package.json +1 -1
- package/plugins/code/code.editor.d.ts +2 -3
- package/plugins/image/image.component.d.ts +1 -4
- package/plugins/image/image.editor.d.ts +4 -7
- package/plugins/link/edit/link-edit.component.d.ts +3 -2
- package/plugins/link/link.editor.d.ts +3 -1
- package/plugins/public-api.d.ts +1 -0
- package/plugins/table/table.editor.d.ts +7 -7
- package/queries/is-range-across-blocks.d.ts +1 -1
- package/transforms/delete-node-by-type.d.ts +3 -0
- package/transforms/index.d.ts +3 -1
- package/transforms/set-node-by-type.d.ts +3 -0
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?: "drag" | "copy" | "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:
|
|
56
|
+
toSlateRange(editor: AngularEditor, domRange: globalThis.Range | StaticRange | Selection): import("slate").BaseRange;
|
|
57
57
|
isLeafBlock(editor: AngularEditor, node: Node): boolean;
|
|
58
58
|
isBlockCardLeftCursor(editor: AngularEditor): boolean;
|
|
59
59
|
isBlockCardRightCursor(editor: AngularEditor): boolean;
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
2
|
import { CodeElement } from '../../custom-types';
|
|
3
3
|
export declare const CodeEditor: {
|
|
4
|
-
setCodeAttribute(editor: Editor,
|
|
5
|
-
[key: string]: unknown;
|
|
6
|
-
}): void;
|
|
4
|
+
setCodeAttribute(editor: Editor, props: Partial<CodeElement>, element?: CodeElement): void;
|
|
7
5
|
insertCode(editor: Editor): void;
|
|
6
|
+
removeCode(editor: Editor, code?: CodeElement): void;
|
|
8
7
|
};
|
|
@@ -69,10 +69,7 @@ export declare class TheImageComponent extends TheBaseElementComponent<ImageElem
|
|
|
69
69
|
openLayoutToolbar(): void;
|
|
70
70
|
closeLayoutToolbar(): void;
|
|
71
71
|
layoutActive(key: Alignment | LayoutTypes): boolean;
|
|
72
|
-
setImageNode(e: MouseEvent,
|
|
73
|
-
layout?: LayoutTypes;
|
|
74
|
-
align?: Alignment;
|
|
75
|
-
}): void;
|
|
72
|
+
setImageNode(e: MouseEvent, props: Partial<ImageElement>): void;
|
|
76
73
|
setBlockCardLayoutAttr(): void;
|
|
77
74
|
onDelete(event: MouseEvent): void;
|
|
78
75
|
createPositionStrategy(): import("@angular/cdk/overlay").FlexibleConnectedPositionStrategy;
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
import { Editor
|
|
2
|
-
import { Alignment, LayoutTypes } from '../../constants';
|
|
1
|
+
import { Editor } from 'slate';
|
|
3
2
|
import { ImageElement } from '../../custom-types';
|
|
4
3
|
export declare const ImageEditor: {
|
|
5
4
|
openUpload(editor: Editor): void;
|
|
6
5
|
insertImages(editor: Editor, imageFiles: FileList | File[]): void;
|
|
7
6
|
handleBase64ImageElement(editor: Editor, image: ImageElement): void;
|
|
8
7
|
verifyImage(editor: Editor, image: File): boolean;
|
|
9
|
-
|
|
10
|
-
setImageNode(editor: Editor,
|
|
11
|
-
layout?: LayoutTypes;
|
|
12
|
-
align?: Alignment;
|
|
13
|
-
}): void;
|
|
8
|
+
isActive(editor: Editor): boolean;
|
|
9
|
+
setImageNode(editor: Editor, props: Partial<ImageElement>, image?: ImageElement): void;
|
|
14
10
|
isBase64(url: string): boolean;
|
|
15
11
|
/**
|
|
16
12
|
* 设置图片来源
|
|
@@ -18,4 +14,5 @@ export declare const ImageEditor: {
|
|
|
18
14
|
* @param image 图片节点
|
|
19
15
|
*/
|
|
20
16
|
setImageSource(editor: Editor, image: ImageElement): void;
|
|
17
|
+
removeImage(editor: Editor, image?: ImageElement): void;
|
|
21
18
|
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { OnInit } from '@angular/core';
|
|
2
2
|
import { ThyPopoverRef } from 'ngx-tethys/popover';
|
|
3
|
-
import { Range,
|
|
3
|
+
import { Range, Editor } from 'slate';
|
|
4
4
|
import { LinkTags } from '../link.types';
|
|
5
|
+
import { LinkElement } from '../../../custom-types';
|
|
5
6
|
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class TheLinkEditComponent implements OnInit {
|
|
7
8
|
thyPopoverRef: ThyPopoverRef<any>;
|
|
8
9
|
className: string;
|
|
9
10
|
tag: LinkTags;
|
|
10
|
-
node:
|
|
11
|
+
node: LinkElement;
|
|
11
12
|
link: string;
|
|
12
13
|
text: string;
|
|
13
14
|
originSelection: Range;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
|
+
import { LinkElement } from '../../custom-types';
|
|
2
3
|
export declare const LinkEditor: {
|
|
3
4
|
insertLink(editor: Editor): void;
|
|
4
|
-
|
|
5
|
+
isActive(editor: Editor): boolean;
|
|
5
6
|
wrapLink(editor: Editor, text: string, url: string): void;
|
|
6
7
|
unwrapLink(editor: Editor): void;
|
|
8
|
+
updateLink(editor: Editor, element: LinkElement, url: string, text: string): void;
|
|
7
9
|
};
|
package/plugins/public-api.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export * from './mark/mark.editor';
|
|
|
12
12
|
export * from './mention/index';
|
|
13
13
|
export * from './quick-insert/quick-insert.editor';
|
|
14
14
|
export * from './table/table.editor';
|
|
15
|
+
export * from './table/utils';
|
|
15
16
|
export * from './todo-item/todo-item.editor';
|
|
16
17
|
export * from './vertical-align/vertical-align.editor';
|
|
17
18
|
export * from './inline-code/inline-code.editor';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor, NodeEntry, Path, Range, Location } from 'slate';
|
|
2
|
-
import {
|
|
2
|
+
import { TableOptions, TheTableOptions } from './table.types';
|
|
3
3
|
import { Alignment, Indents, MarkTypes, VerticalAlignment } from '../../constants';
|
|
4
4
|
import { TheEditor } from '../../interfaces';
|
|
5
5
|
import { CustomElement, TableCellElement, TableElement } from '../../custom-types';
|
|
@@ -11,17 +11,17 @@ export declare const TableEditor: {
|
|
|
11
11
|
removeRow(editor: Editor, rowIndex?: number, optionsParam?: TableOptions): void;
|
|
12
12
|
removeColumn(editor: Editor, colIndex?: number, optionsParam?: TableOptions): void;
|
|
13
13
|
clearCell(editor: Editor, nodeEntry?: NodeEntry<CustomElement>, optionsParam?: TableOptions): void;
|
|
14
|
-
setCellsBackgroundColor(editor: Editor, color: string,
|
|
14
|
+
setCellsBackgroundColor(editor: Editor, color: string, cells?: TableCellElement[]): void;
|
|
15
15
|
mergeCell(editor: Editor): void;
|
|
16
16
|
splitCell(editor: Editor): void;
|
|
17
17
|
setTableOptions(editor: Editor, newOptions: TheTableOptions): void;
|
|
18
18
|
setEquallyColumn(editor: Editor): void;
|
|
19
|
-
clearCellsContent(editor: Editor,
|
|
19
|
+
clearCellsContent(editor: Editor, cells?: TableCellElement[]): void;
|
|
20
20
|
isActive(editor: Editor): boolean;
|
|
21
|
-
getSelectedCellPositions(editor: Editor): CellPosition[];
|
|
21
|
+
getSelectedCellPositions(editor: Editor): import("./table.types").CellPosition[];
|
|
22
22
|
getSelectedCells(editor: Editor): TableCellElement[];
|
|
23
|
-
setAlign(editor: Editor, alignment: Alignment): boolean;
|
|
24
|
-
setVerticalAlign(editor: TheEditor, alignment: VerticalAlignment): boolean;
|
|
23
|
+
setAlign(editor: Editor, alignment: Alignment, cells?: TableCellElement[]): boolean;
|
|
24
|
+
setVerticalAlign(editor: TheEditor, alignment: VerticalAlignment, cells?: TableCellElement[]): boolean;
|
|
25
25
|
isVerticalAlignActive(editor: TheEditor, alignment: VerticalAlignment): boolean;
|
|
26
26
|
toggleMark(editor: TheEditor, isActive: boolean, format: string | string[], value?: string | number | boolean): boolean;
|
|
27
27
|
clearMark(editor: TheEditor): boolean;
|
|
@@ -34,7 +34,7 @@ export declare const TableEditor: {
|
|
|
34
34
|
"background-color"?: any;
|
|
35
35
|
"font-size"?: any;
|
|
36
36
|
}): boolean;
|
|
37
|
-
handleSelectedCells(editor: TheEditor, handle: (cellPath: Path, cellRange: Range) => void): boolean;
|
|
37
|
+
handleSelectedCells(editor: TheEditor, handle: (cellPath: Path, cellRange: Range) => void, cells?: TableCellElement[]): boolean;
|
|
38
38
|
hasHeaderRow(editor: TheEditor, location?: Location): boolean;
|
|
39
39
|
hasHeaderColumn(editor: TheEditor, location?: Location): boolean;
|
|
40
40
|
isActiveHeader(editor: TheEditor, location?: Location): boolean;
|
|
@@ -3,6 +3,6 @@ import { EditorAboveOptions } from '../interfaces';
|
|
|
3
3
|
/**
|
|
4
4
|
* Is the range (default: selection) across blocks.
|
|
5
5
|
*/
|
|
6
|
-
export declare const isRangeAcrossBlocks: (editor: Editor, { at, ...options }?: Omit<EditorAboveOptions<import("slate").Ancestor>, "
|
|
6
|
+
export declare const isRangeAcrossBlocks: (editor: Editor, { at, ...options }?: Omit<EditorAboveOptions<import("slate").Ancestor>, "at" | "match"> & {
|
|
7
7
|
at?: Range | null;
|
|
8
8
|
}) => boolean;
|
package/transforms/index.d.ts
CHANGED
|
@@ -14,4 +14,6 @@ import { setEndSelection } from './set-end-selection';
|
|
|
14
14
|
import { closeConversionHint } from './close-conversion-hint';
|
|
15
15
|
import { handleContinualDeleteBackward } from './handle-continual-delete-backward';
|
|
16
16
|
import { handleContinualInsertBreak } from './handle-continual-insert-break';
|
|
17
|
-
|
|
17
|
+
import { deleteNodeByType } from './delete-node-by-type';
|
|
18
|
+
import { setNodeByType } from './set-node-by-type';
|
|
19
|
+
export { setMarks, clearMarks, insertElements, insertParagraph, setNode, unwrapNodesByType, onKeyDownResetBlockType, moveChildren, applyDeepToNodes, mergeDeepToNodes, unWrap, deleteElement, setEndSelection, closeConversionHint, handleContinualDeleteBackward, handleContinualInsertBreak, deleteNodeByType, setNodeByType };
|