@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.
Files changed (34) hide show
  1. package/editor.module.d.ts +2 -2
  2. package/esm2022/components/contextmenu/contextmenu.component.mjs +1 -1
  3. package/esm2022/plugins/code/code.component.mjs +8 -8
  4. package/esm2022/plugins/code/code.editor.mjs +18 -7
  5. package/esm2022/plugins/color/toolbar-item.component.mjs +1 -1
  6. package/esm2022/plugins/image/image.component.mjs +5 -8
  7. package/esm2022/plugins/image/image.editor.mjs +19 -4
  8. package/esm2022/plugins/image/image.plugin.mjs +3 -3
  9. package/esm2022/plugins/link/edit/link-edit.component.mjs +4 -15
  10. package/esm2022/plugins/link/link.component.mjs +4 -4
  11. package/esm2022/plugins/link/link.editor.mjs +21 -4
  12. package/esm2022/plugins/link/link.plugin.mjs +3 -3
  13. package/esm2022/plugins/public-api.mjs +2 -1
  14. package/esm2022/plugins/table/components/toolbar/table-toolbar.component.mjs +1 -1
  15. package/esm2022/plugins/table/table.editor.mjs +21 -22
  16. package/esm2022/plugins/table/table.plugin.mjs +2 -2
  17. package/esm2022/transforms/delete-node-by-type.mjs +10 -0
  18. package/esm2022/transforms/index.mjs +4 -2
  19. package/esm2022/transforms/set-node-by-type.mjs +10 -0
  20. package/fesm2022/worktile-theia.mjs +111 -66
  21. package/fesm2022/worktile-theia.mjs.map +1 -1
  22. package/interfaces/editor.d.ts +2 -2
  23. package/package.json +1 -1
  24. package/plugins/code/code.editor.d.ts +2 -3
  25. package/plugins/image/image.component.d.ts +1 -4
  26. package/plugins/image/image.editor.d.ts +4 -7
  27. package/plugins/link/edit/link-edit.component.d.ts +3 -2
  28. package/plugins/link/link.editor.d.ts +3 -1
  29. package/plugins/public-api.d.ts +1 -0
  30. package/plugins/table/table.editor.d.ts +7 -7
  31. package/queries/is-range-across-blocks.d.ts +1 -1
  32. package/transforms/delete-node-by-type.d.ts +3 -0
  33. package/transforms/index.d.ts +3 -1
  34. package/transforms/set-node-by-type.d.ts +3 -0
@@ -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?: "copy" | "drag" | "cut"): void;
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: Selection | globalThis.Range | StaticRange): import("slate").BaseRange;
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,6 +1,6 @@
1
1
  {
2
2
  "name": "@worktile/theia",
3
- "version": "16.3.3",
3
+ "version": "16.3.4",
4
4
  "description": "theia editor",
5
5
  "author": "YanDong <nanianqiumo@foxmail.com>",
6
6
  "homepage": "https://github.com/atinc/theia#readme",
@@ -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, element: CodeElement, value: {
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, partial: {
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, Path } from 'slate';
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
- isImageActive(editor: Editor): boolean;
10
- setImageNode(editor: Editor, path: Path, partial: {
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, Node, Editor } from 'slate';
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: 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
- isLinkActive(editor: Editor): boolean;
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
  };
@@ -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 { CellPosition, TableOptions, TheTableOptions } from './table.types';
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, selectCells?: TableCellElement[]): void;
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, selectCells?: CellPosition[]): void;
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>, "match" | "at"> & {
6
+ export declare const isRangeAcrossBlocks: (editor: Editor, { at, ...options }?: Omit<EditorAboveOptions<import("slate").Ancestor>, "at" | "match"> & {
7
7
  at?: Range | null;
8
8
  }) => boolean;
@@ -0,0 +1,3 @@
1
+ import { Editor } from 'slate';
2
+ import { CustomElementKinds } from '../custom-types';
3
+ export declare const deleteNodeByType: (editor: Editor, type: CustomElementKinds) => void;
@@ -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
- export { setMarks, clearMarks, insertElements, insertParagraph, setNode, unwrapNodesByType, onKeyDownResetBlockType, moveChildren, applyDeepToNodes, mergeDeepToNodes, unWrap, deleteElement, setEndSelection, closeConversionHint, handleContinualDeleteBackward, handleContinualInsertBreak };
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 };
@@ -0,0 +1,3 @@
1
+ import { Editor, Node } from 'slate';
2
+ import { CustomElementKinds } from '../custom-types';
3
+ export declare const setNodeByType: (editor: Editor, props: Partial<Node>, type: CustomElementKinds) => void;