@worktile/theia 18.0.0-next.0 → 18.0.1

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/components/text/text.component.d.ts +1 -4
  2. package/esm2022/components/text/text.component.mjs +7 -8
  3. package/esm2022/interfaces/image.mjs +2 -2
  4. package/esm2022/plugins/blockquote/blockquote.component.mjs +3 -8
  5. package/esm2022/plugins/code/code.component.mjs +24 -26
  6. package/esm2022/plugins/hr/hr.component.mjs +3 -8
  7. package/esm2022/plugins/image/image.component.mjs +27 -21
  8. package/esm2022/plugins/image/image.editor.mjs +6 -3
  9. package/esm2022/plugins/link/link.component.mjs +16 -18
  10. package/esm2022/plugins/link/link.plugin.mjs +5 -5
  11. package/esm2022/plugins/list/components/bulleted-list.component.mjs +3 -8
  12. package/esm2022/plugins/list/components/list-item.component.mjs +3 -8
  13. package/esm2022/plugins/list/components/numbered-list.component.mjs +5 -7
  14. package/esm2022/plugins/table/components/row/row.component.mjs +7 -9
  15. package/esm2022/plugins/table/components/table.component.mjs +5 -5
  16. package/esm2022/plugins/table/components/td/td.component.mjs +20 -23
  17. package/esm2022/plugins/todo-item/todo-item.component.mjs +10 -12
  18. package/fesm2022/worktile-theia.mjs +127 -150
  19. package/fesm2022/worktile-theia.mjs.map +1 -1
  20. package/interfaces/editor.d.ts +7 -7
  21. package/interfaces/image.d.ts +7 -4
  22. package/package.json +2 -2
  23. package/plugins/blockquote/blockquote.component.d.ts +0 -4
  24. package/plugins/code/code.component.d.ts +7 -13
  25. package/plugins/hr/hr.component.d.ts +1 -4
  26. package/plugins/image/image.component.d.ts +4 -4
  27. package/plugins/link/link.component.d.ts +4 -8
  28. package/plugins/list/components/bulleted-list.component.d.ts +1 -4
  29. package/plugins/list/components/list-item.component.d.ts +1 -4
  30. package/plugins/list/components/numbered-list.component.d.ts +2 -4
  31. package/plugins/table/components/row/row.component.d.ts +2 -5
  32. package/plugins/table/components/table.component.d.ts +1 -1
  33. package/plugins/table/components/td/td.component.d.ts +7 -10
  34. package/plugins/todo-item/todo-item.component.d.ts +1 -4
@@ -54,19 +54,19 @@ export declare const TheEditor: {
54
54
  toDOMRange(editor: AngularEditor, range: Range): globalThis.Range;
55
55
  toSlateNode<T extends boolean>(editor: AngularEditor, domNode: globalThis.Node, options?: {
56
56
  suppressThrow: T;
57
- }): T extends true ? Node : Node;
57
+ }): T extends true ? Node | null : Node;
58
58
  findEventRange(editor: AngularEditor, event: any): Range;
59
59
  isLeafInEditor(editor: AngularEditor, leafNode: globalThis.Element, options: {
60
60
  suppressThrow: boolean;
61
61
  }): boolean;
62
- toSlatePoint<T_1 extends boolean>(editor: AngularEditor, domPoint: import("slate-angular").DOMPoint, options: {
62
+ toSlatePoint<T extends boolean>(editor: AngularEditor, domPoint: import("slate-angular").DOMPoint, options: {
63
63
  exactMatch?: boolean;
64
- suppressThrow: T_1;
65
- }): T_1 extends true ? import("slate").BasePoint : import("slate").BasePoint;
66
- toSlateRange<T_2 extends boolean>(editor: AngularEditor, domRange: globalThis.Range | StaticRange | Selection, options?: {
64
+ suppressThrow: T;
65
+ }): T extends true ? Point | null : Point;
66
+ toSlateRange<T extends boolean>(editor: AngularEditor, domRange: globalThis.Range | StaticRange | Selection, options?: {
67
67
  exactMatch?: boolean;
68
- suppressThrow: T_2;
69
- }): T_2 extends true ? import("slate").BaseRange : import("slate").BaseRange;
68
+ suppressThrow: T;
69
+ }): T extends true ? Range | null : Range;
70
70
  isLeafBlock(editor: AngularEditor, node: Node): boolean;
71
71
  isBlockCardLeftCursor(editor: AngularEditor): boolean;
72
72
  isBlockCardRightCursor(editor: AngularEditor): boolean;
@@ -2,7 +2,7 @@ import { InjectionToken } from '@angular/core';
2
2
  import { SafeUrl } from '@angular/platform-browser';
3
3
  import { Observable } from 'rxjs';
4
4
  import { Alignment, LayoutTypes } from '../constants';
5
- import { CustomElementKinds } from '../custom-types';
5
+ import { CustomElementKinds, ImageElement } from '../custom-types';
6
6
  import { TheEditor } from './editor';
7
7
  import { ToolbarItem } from './toolbar';
8
8
  import { FileUploadingItem, UploadFileEntity } from './upload';
@@ -27,13 +27,16 @@ export interface PreviewImageInfo {
27
27
  export interface LayoutOption extends ToolbarItem {
28
28
  handle?: (e: MouseEvent, key: Alignment | LayoutTypes) => void;
29
29
  }
30
- export interface TheImageUploaderService {
30
+ export interface TheImageService {
31
31
  uploadFileHandle: (files: File | string) => Observable<UploadFileEntity[]>;
32
32
  getUploadingItems$: () => Observable<FileUploadingItem[]>;
33
- buildImageUrl?: (imageUrl: string) => string;
34
33
  isExternalUrl?: (imageUrl: string) => boolean;
34
+ getImageUrl?: (element: ImageElement) => Observable<{
35
+ thumbUrl: string;
36
+ originUrl: string;
37
+ }>;
35
38
  }
36
- export declare const THE_UPLOAD_SERVICE_TOKEN: InjectionToken<TheImageUploaderService>;
39
+ export declare const THE_IMAGE_SERVICE_TOKEN: InjectionToken<TheImageService>;
37
40
  export interface ImagePluginOptions {
38
41
  allowParentTypes?: CustomElementKinds[];
39
42
  imageTypes?: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worktile/theia",
3
- "version": "18.0.0-next.0",
3
+ "version": "18.0.1",
4
4
  "description": "theia editor",
5
5
  "author": "YanDong <nanianqiumo@foxmail.com>",
6
6
  "homepage": "https://github.com/atinc/theia#readme",
@@ -39,7 +39,7 @@
39
39
  "peerDependencies": {
40
40
  "@angular/core": "^18.0.0",
41
41
  "date-fns": ">= 2.6.0",
42
- "slate-angular": ">= 18.0.0-next.0",
42
+ "slate-angular": ">= 18.0.1",
43
43
  "slate": ">= 0.103.0",
44
44
  "ngx-tethys": "^18.0.0",
45
45
  "ng-codemirror": "^18.0.0",
@@ -1,11 +1,7 @@
1
- import { ChangeDetectorRef, ElementRef } from '@angular/core';
2
1
  import { Editor, Element } from 'slate';
3
2
  import { TheBaseElement } from '../../interfaces';
4
3
  import * as i0 from "@angular/core";
5
4
  export declare class TheBlockquote extends TheBaseElement<Element, Editor> {
6
- elementRef: ElementRef;
7
- cdr: ChangeDetectorRef;
8
- constructor(elementRef: ElementRef, cdr: ChangeDetectorRef);
9
5
  static ɵfac: i0.ɵɵFactoryDeclaration<TheBlockquote, never>;
10
6
  static ɵcmp: i0.ɵɵComponentDeclaration<TheBlockquote, "blockquote[theBlockquote]", never, {}, {}, never, never, true, never>;
11
7
  }
@@ -1,8 +1,6 @@
1
- import { Overlay } from '@angular/cdk/overlay';
2
- import { AfterViewInit, ChangeDetectorRef, ElementRef, NgZone, OnDestroy, OnInit, TemplateRef } from '@angular/core';
1
+ import { AfterViewInit, OnDestroy, OnInit, TemplateRef } from '@angular/core';
3
2
  import { CodeMirrorComponent } from 'ng-codemirror';
4
- import { ThyNotifyService } from 'ngx-tethys/notify';
5
- import { ThyPopover, ThyPopoverRef } from 'ngx-tethys/popover';
3
+ import { ThyPopoverRef } from 'ngx-tethys/popover';
6
4
  import { ThyResizeEvent } from 'ngx-tethys/resizable';
7
5
  import { Subject } from 'rxjs';
8
6
  import { Editor } from 'slate';
@@ -10,16 +8,8 @@ import { TheToolbarDropdown } from '../../components';
10
8
  import { DropdownMode } from '../../constants';
11
9
  import { CodeElement } from '../../custom-types';
12
10
  import { DefaultToolbarItem, TheBaseElement } from '../../interfaces';
13
- import { TheContextService } from '../../services/context.service';
14
11
  import * as i0 from "@angular/core";
15
12
  export declare class TheCode extends TheBaseElement<CodeElement, Editor> implements OnInit, AfterViewInit, OnDestroy {
16
- elementRef: ElementRef;
17
- cdr: ChangeDetectorRef;
18
- private thyNotifyService;
19
- private contextService;
20
- private ngZone;
21
- private thyPopover;
22
- private overlay;
23
13
  startRenderCodemirror: boolean;
24
14
  dropdownMode: typeof DropdownMode;
25
15
  maxHeight: number;
@@ -47,7 +37,11 @@ export declare class TheCode extends TheBaseElement<CodeElement, Editor> impleme
47
37
  toolbarDropdown: TheToolbarDropdown;
48
38
  get code(): string;
49
39
  get isToolbarOpen(): boolean;
50
- constructor(elementRef: ElementRef, cdr: ChangeDetectorRef, thyNotifyService: ThyNotifyService, contextService: TheContextService, ngZone: NgZone, thyPopover: ThyPopover, overlay: Overlay);
40
+ private thyNotifyService;
41
+ private contextService;
42
+ private ngZone;
43
+ private thyPopover;
44
+ private overlay;
51
45
  onContextChange(): void;
52
46
  ngOnInit(): void;
53
47
  ngAfterViewInit(): void;
@@ -1,11 +1,8 @@
1
- import { AfterViewInit, ChangeDetectorRef, ElementRef } from '@angular/core';
1
+ import { AfterViewInit } from '@angular/core';
2
2
  import { Editor, Element } from 'slate';
3
3
  import { TheBaseElement } from '../../interfaces';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class TheHr extends TheBaseElement<Element, Editor> implements AfterViewInit {
6
- elementRef: ElementRef;
7
- cdr: ChangeDetectorRef;
8
- constructor(elementRef: ElementRef, cdr: ChangeDetectorRef);
9
6
  ngAfterViewInit(): void;
10
7
  static ɵfac: i0.ɵɵFactoryDeclaration<TheHr, never>;
11
8
  static ɵcmp: i0.ɵɵComponentDeclaration<TheHr, "the-hr, [theHr]", never, {}, {}, never, never, true, never>;
@@ -6,14 +6,13 @@ import { Editor } from 'slate';
6
6
  import { BeforeContextChange, SlateElementContext } from 'slate-angular';
7
7
  import { Alignment, LayoutTypes } from '../../constants';
8
8
  import { ImageElement } from '../../custom-types';
9
- import { ImageEntry, LayoutOption, TheBaseElement, TheImageUploaderService } from '../../interfaces';
9
+ import { ImageEntry, LayoutOption, TheBaseElement, TheImageService } from '../../interfaces';
10
10
  import { TheContextService } from '../../services/context.service';
11
11
  import * as i0 from "@angular/core";
12
12
  export declare class TheImage extends TheBaseElement<ImageElement, Editor> implements OnInit, OnDestroy, AfterViewInit, BeforeContextChange<SlateElementContext> {
13
- elementRef: ElementRef;
14
13
  cdr: ChangeDetectorRef;
15
14
  imageGroup: ThyImageGroup;
16
- private imageUploaderService;
15
+ private imageService;
17
16
  private theContextService;
18
17
  private thyPopover;
19
18
  private overlay;
@@ -42,8 +41,9 @@ export declare class TheImage extends TheBaseElement<ImageElement, Editor> imple
42
41
  img: ElementRef;
43
42
  layoutToolbar: TemplateRef<any>;
44
43
  imageDirective: ThyImageDirective;
45
- constructor(elementRef: ElementRef, cdr: ChangeDetectorRef, imageGroup: ThyImageGroup, imageUploaderService: TheImageUploaderService, theContextService: TheContextService, thyPopover: ThyPopover, overlay: Overlay, destroyRef: DestroyRef);
44
+ constructor(cdr: ChangeDetectorRef, imageGroup: ThyImageGroup, imageService: TheImageService, theContextService: TheContextService, thyPopover: ThyPopover, overlay: Overlay, destroyRef: DestroyRef);
46
45
  beforeContextChange: (value: SlateElementContext<ImageElement>) => void;
46
+ buildImageEntry(newElement: ImageElement, thumbUrl: string, originUrl: string): void;
47
47
  ngOnInit(): void;
48
48
  ngAfterViewInit(): void;
49
49
  onContextChange(): void;
@@ -1,6 +1,5 @@
1
- import { Overlay } from '@angular/cdk/overlay';
2
- import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit } from '@angular/core';
3
- import { ThyPopover, ThyPopoverRef } from 'ngx-tethys/popover';
1
+ import { ElementRef, OnDestroy, OnInit } from '@angular/core';
2
+ import { ThyPopoverRef } from 'ngx-tethys/popover';
4
3
  import { Editor } from 'slate';
5
4
  import { SlateElementContext } from 'slate-angular';
6
5
  import { LinkElement } from '../../custom-types';
@@ -8,15 +7,12 @@ import { TheBaseElement } from '../../interfaces';
8
7
  import { LinkTags } from './link.types';
9
8
  import * as i0 from "@angular/core";
10
9
  export declare class TheBaseLink extends TheBaseElement<LinkElement, Editor> implements OnInit, OnDestroy {
11
- elementRef: ElementRef;
12
- cdr: ChangeDetectorRef;
13
- private thyPopover;
14
- private overlay;
15
10
  thyPopoverHoverRef: ThyPopoverRef<any>;
16
11
  thyPopoverEditRef: ThyPopoverRef<any>;
17
12
  get linkHoverOpened(): boolean;
18
13
  get linkEditOpened(): boolean;
19
- constructor(elementRef: ElementRef, cdr: ChangeDetectorRef, thyPopover: ThyPopover, overlay: Overlay);
14
+ private thyPopover;
15
+ private overlay;
20
16
  ngOnInit(): void;
21
17
  closeHoverPopover(): void;
22
18
  beforeContextChange: (value: SlateElementContext) => void;
@@ -1,13 +1,10 @@
1
- import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit } from '@angular/core';
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { Editor } from 'slate';
3
3
  import { BulletedListElement } from '../../../custom-types';
4
4
  import { TheBaseElement } from '../../../interfaces';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class TheBulletedList extends TheBaseElement<BulletedListElement, Editor> implements OnInit, OnDestroy {
7
- elementRef: ElementRef;
8
- cdr: ChangeDetectorRef;
9
7
  get level(): number;
10
- constructor(elementRef: ElementRef, cdr: ChangeDetectorRef);
11
8
  ngOnInit(): void;
12
9
  ngOnDestroy(): void;
13
10
  static ɵfac: i0.ɵɵFactoryDeclaration<TheBulletedList, never>;
@@ -1,12 +1,9 @@
1
- import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit } from '@angular/core';
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { Editor, Element } from 'slate';
3
3
  import { TheBaseElement } from '../../../interfaces';
4
4
  import * as i0 from "@angular/core";
5
5
  export declare class TheListItem extends TheBaseElement<Element, Editor> implements OnInit, OnDestroy {
6
- elementRef: ElementRef;
7
- cdr: ChangeDetectorRef;
8
6
  fontSizeClass: string;
9
- constructor(elementRef: ElementRef, cdr: ChangeDetectorRef);
10
7
  ngOnInit(): void;
11
8
  onContextChange(): void;
12
9
  ngOnDestroy(): void;
@@ -1,14 +1,12 @@
1
- import { ChangeDetectorRef, ElementRef, OnDestroy, OnInit } from '@angular/core';
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
2
  import { Editor } from 'slate';
3
3
  import { NumberedListElement } from '../../../custom-types';
4
4
  import { TheBaseElement } from '../../../interfaces';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class TheNumberedList extends TheBaseElement<NumberedListElement, Editor> implements OnInit, OnDestroy {
7
- elementRef: ElementRef;
8
- cdr: ChangeDetectorRef;
9
7
  get start(): number;
10
8
  get level(): number;
11
- constructor(elementRef: ElementRef, cdr: ChangeDetectorRef);
9
+ constructor();
12
10
  ngOnInit(): void;
13
11
  ngOnDestroy(): void;
14
12
  static ɵfac: i0.ɵɵFactoryDeclaration<TheNumberedList, never>;
@@ -1,17 +1,14 @@
1
- import { AfterViewInit, ChangeDetectorRef, ElementRef, OnInit, Renderer2 } from '@angular/core';
1
+ import { AfterViewInit, ElementRef, OnInit } from '@angular/core';
2
2
  import { AfterContextChange } from 'slate-angular';
3
3
  import { TableRowElement } from '../../../../custom-types';
4
4
  import { TheBaseElement } from '../../../../interfaces/view-base';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class TheTableRow extends TheBaseElement<TableRowElement> implements OnInit, AfterViewInit, AfterContextChange {
7
- elementRef: ElementRef<HTMLElement>;
8
- cdr: ChangeDetectorRef;
9
- private renderer;
10
7
  height: string;
11
8
  numberedColumn: boolean;
12
9
  rowNumber: number | string;
13
10
  numberedColumnRef: ElementRef<HTMLElement>;
14
- constructor(elementRef: ElementRef<HTMLElement>, cdr: ChangeDetectorRef, renderer: Renderer2);
11
+ private renderer;
15
12
  onContextChange(): void;
16
13
  afterContextChange(): void;
17
14
  ngOnInit(): void;
@@ -64,7 +64,7 @@ export declare class TheTable extends TheBaseElement<TableElement, Editor> imple
64
64
  onContextChange(): void;
65
65
  afterChildrenViewUpdate(): void;
66
66
  afterRowControlsUpdate(): void;
67
- constructor(elementRef: ElementRef<HTMLElement>, eventDispatcher: TableCellEventDispatcher, resizeNotifier: ColumnResizeNotifierSource, tableStore: TableStore, cdr: ChangeDetectorRef, ngZone: NgZone, tableService: TableService, theTableContextMenuService: TheTableContextMenuService, freezeColumnPipe: TableFreezeColumnPipe, freezeRowPipe: TableFreezeRowPipe, renderer: Renderer2, contextService: TheContextService, config: TheModeConfig);
67
+ constructor(eventDispatcher: TableCellEventDispatcher, resizeNotifier: ColumnResizeNotifierSource, tableStore: TableStore, cdr: ChangeDetectorRef, ngZone: NgZone, tableService: TableService, theTableContextMenuService: TheTableContextMenuService, freezeColumnPipe: TableFreezeColumnPipe, freezeRowPipe: TableFreezeRowPipe, renderer: Renderer2, contextService: TheContextService, config: TheModeConfig);
68
68
  ngOnInit(): void;
69
69
  getWrapperWidthAndLeft(): void;
70
70
  ngAfterViewInit(): void;
@@ -1,5 +1,5 @@
1
1
  import { ConnectedPosition, Overlay, OverlayRef, ScrollDispatcher } from '@angular/cdk/overlay';
2
- import { AfterViewInit, ChangeDetectorRef, ElementRef, Injector, NgZone, OnDestroy, OnInit, Renderer2 } from '@angular/core';
2
+ import { AfterViewInit, ElementRef, Injector, OnDestroy, OnInit } from '@angular/core';
3
3
  import { Subject } from 'rxjs';
4
4
  import { Editor } from 'slate';
5
5
  import { ColumnResizeNotifierSource } from '../../../../components/column-resize/column-resize-notifier';
@@ -16,14 +16,6 @@ export declare const POSITION_MAP: {
16
16
  [key: string]: ConnectedPosition;
17
17
  };
18
18
  export declare class TheTd extends TheBaseElement<TableCellElement, Editor> implements OnInit, AfterViewInit, OnDestroy {
19
- elementRef: ElementRef<HTMLTableCellElement>;
20
- cdr: ChangeDetectorRef;
21
- private renderer;
22
- private ngZone;
23
- injector: Injector;
24
- overlay: Overlay;
25
- resizingStore: ColumnResizingStore;
26
- scrollDispatcher: ScrollDispatcher;
27
19
  destroy$: Subject<void>;
28
20
  tablePosition: TablePosition;
29
21
  tableComponent: TheTable;
@@ -50,7 +42,12 @@ export declare class TheTd extends TheBaseElement<TableCellElement, Editor> impl
50
42
  display: string;
51
43
  onContextChange(): void;
52
44
  getOutletParent: () => any;
53
- constructor(elementRef: ElementRef<HTMLTableCellElement>, cdr: ChangeDetectorRef, renderer: Renderer2, ngZone: NgZone, injector: Injector, overlay: Overlay, resizingStore: ColumnResizingStore, scrollDispatcher: ScrollDispatcher);
45
+ private renderer;
46
+ private ngZone;
47
+ injector: Injector;
48
+ overlay: Overlay;
49
+ resizingStore: ColumnResizingStore;
50
+ scrollDispatcher: ScrollDispatcher;
54
51
  ngOnInit(): void;
55
52
  ngAfterViewInit(): void;
56
53
  getInjectionService(): void;
@@ -1,11 +1,9 @@
1
- import { ChangeDetectorRef, ElementRef, OnInit } from '@angular/core';
1
+ import { ElementRef, OnInit } from '@angular/core';
2
2
  import { Editor } from 'slate';
3
3
  import { TodoItemElement } from '../../custom-types';
4
4
  import { TheBaseElement } from '../../interfaces';
5
5
  import * as i0 from "@angular/core";
6
6
  export declare class TheTodoItem extends TheBaseElement<TodoItemElement, Editor> implements OnInit {
7
- elementRef: ElementRef;
8
- cdr: ChangeDetectorRef;
9
7
  checked: boolean;
10
8
  checkItemClass: boolean;
11
9
  get checkItemSelectable(): boolean;
@@ -13,7 +11,6 @@ export declare class TheTodoItem extends TheBaseElement<TodoItemElement, Editor>
13
11
  get editableWithReadonly(): boolean;
14
12
  childrenOutlet: ElementRef;
15
13
  getOutletParent: () => any;
16
- constructor(elementRef: ElementRef, cdr: ChangeDetectorRef);
17
14
  ngOnInit(): void;
18
15
  onCheck(checked: boolean): boolean;
19
16
  static ɵfac: i0.ɵɵFactoryDeclaration<TheTodoItem, never>;