@worktile/theia 14.0.4 → 14.1.0

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 (38) hide show
  1. package/custom-types.d.ts +1 -1
  2. package/editor.module.d.ts +18 -18
  3. package/esm2020/custom-types.mjs +1 -1
  4. package/esm2020/editor.component.mjs +3 -3
  5. package/esm2020/editor.module.mjs +47 -47
  6. package/esm2020/interfaces/editor.mjs +1 -1
  7. package/esm2020/interfaces/plugins/plugin-key.mjs +2 -1
  8. package/esm2020/plugins/deserializers/deserialize-html.plugin.mjs +4 -4
  9. package/esm2020/plugins/hr/hr.editor.mjs +9 -1
  10. package/esm2020/plugins/index.mjs +28 -26
  11. package/esm2020/plugins/mention/index.mjs +5 -0
  12. package/esm2020/plugins/mention/mention.editor.mjs +168 -0
  13. package/esm2020/plugins/mention/mention.plugin.mjs +92 -0
  14. package/esm2020/plugins/mention/mention.type.mjs +2 -0
  15. package/esm2020/plugins/mention/suggestion.component.mjs +29 -0
  16. package/esm2020/plugins/public-api.mjs +5 -4
  17. package/esm2020/plugins/quick-insert/components/quick-insert.component.mjs +1 -1
  18. package/esm2020/plugins/quick-insert/quick-insert.plugin.mjs +6 -6
  19. package/esm2020/plugins/table/components/td/td.component.mjs +2 -2
  20. package/esm2020/utils/common.mjs +9 -1
  21. package/esm2020/utils/weak-maps.mjs +3 -1
  22. package/fesm2015/worktile-theia.mjs +10358 -10067
  23. package/fesm2015/worktile-theia.mjs.map +1 -1
  24. package/fesm2020/worktile-theia.mjs +10264 -9973
  25. package/fesm2020/worktile-theia.mjs.map +1 -1
  26. package/interfaces/editor.d.ts +1 -1
  27. package/interfaces/plugins/plugin-key.d.ts +2 -1
  28. package/package.json +1 -1
  29. package/plugins/deserializers/deserialize-html.plugin.d.ts +2 -2
  30. package/plugins/hr/hr.editor.d.ts +1 -0
  31. package/plugins/mention/index.d.ts +4 -0
  32. package/plugins/mention/mention.editor.d.ts +17 -0
  33. package/plugins/mention/mention.plugin.d.ts +3 -0
  34. package/plugins/mention/mention.type.d.ts +10 -0
  35. package/plugins/mention/suggestion.component.d.ts +17 -0
  36. package/plugins/public-api.d.ts +4 -3
  37. package/utils/common.d.ts +1 -0
  38. package/utils/weak-maps.d.ts +3 -1
@@ -91,7 +91,7 @@ export interface TheOptions {
91
91
  autoFocus?: boolean;
92
92
  placeholder?: string;
93
93
  placeholderDecorate?: (editor: Editor) => SlatePlaceholder[];
94
- inlineToobarVisible?: boolean;
94
+ inlineToolbarVisible?: boolean;
95
95
  quickInsertVisible?: boolean;
96
96
  scrollContainer?: string;
97
97
  maxHeight?: number;
@@ -34,7 +34,8 @@ export declare enum PluginKeys {
34
34
  deserializeHtml = "deserialize-html",
35
35
  deserializeMd = "deserialize-md",
36
36
  quickInsert = "quick-insert",
37
- paintFormat = "paint-format"
37
+ paintFormat = "paint-format",
38
+ mention = "mention"
38
39
  }
39
40
  /**
40
41
  * 通过 key 存储插件的唯一 key。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worktile/theia",
3
- "version": "14.0.4",
3
+ "version": "14.1.0",
4
4
  "description": "theia editor",
5
5
  "author": "YanDong <nanianqiumo@foxmail.com>",
6
6
  "homepage": "https://github.com/atinc/theia#readme",
@@ -1,2 +1,2 @@
1
- export declare const withDeserializeHMTL: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
2
- export declare const createDeserializeHMTLPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
1
+ export declare const withDeserializeHTML: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
2
+ export declare const createDeserializeHTMLPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
@@ -1,4 +1,5 @@
1
1
  import { Editor } from 'slate';
2
2
  export declare const HrEditor: {
3
3
  insertHr(editor: Editor): void;
4
+ isHrActive(editor: Editor): boolean;
4
5
  };
@@ -0,0 +1,4 @@
1
+ export * from './mention.type';
2
+ export * from './mention.editor';
3
+ export * from './mention.plugin';
4
+ export * from './suggestion.component';
@@ -0,0 +1,17 @@
1
+ import { ElementRef } from '@angular/core';
2
+ import { TheEditor } from '../../interfaces';
3
+ export declare const MentionEditor: {
4
+ insertTrigger(editor: TheEditor, type: string): void;
5
+ deleteTriggerText(editor: TheEditor): void;
6
+ openSuggestion(editor: TheEditor, type: string): void;
7
+ getSearchInfo(editor: TheEditor): {
8
+ currentRange: import("slate").BaseRange;
9
+ currentText: string;
10
+ };
11
+ updateSearchText(editor: TheEditor, text: string): void;
12
+ openSelectOverlay(editor: TheEditor, type: string, origin: ElementRef | HTMLElement): void;
13
+ close(editor: TheEditor): void;
14
+ insertMention<T>(editor: TheEditor, type: string, data: T): void;
15
+ isActive(editor: TheEditor, type: string): boolean;
16
+ createPositionStrategy(editor: TheEditor): import("@angular/cdk/overlay").FlexibleConnectedPositionStrategy;
17
+ };
@@ -0,0 +1,3 @@
1
+ import { MentionPluginOptions } from './mention.type';
2
+ export declare const withMention: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
3
+ export declare const createMentionPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, MentionPluginOptions>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, MentionPluginOptions>;
@@ -0,0 +1,10 @@
1
+ import { ComponentType } from '@angular/cdk/portal';
2
+ export interface TheMention<T = unknown> {
3
+ type: string;
4
+ trigger: string;
5
+ suggestion: ComponentType<any>;
6
+ render: ComponentType<any>;
7
+ }
8
+ export interface MentionPluginOptions {
9
+ mentions: TheMention[];
10
+ }
@@ -0,0 +1,17 @@
1
+ import { ElementRef, OnInit } from '@angular/core';
2
+ import { TheEditor } from '../../interfaces';
3
+ import * as i0 from "@angular/core";
4
+ export declare abstract class TheBaseSuggestion implements OnInit {
5
+ elementRef: ElementRef;
6
+ theBindDom: HTMLElement;
7
+ editor: TheEditor;
8
+ type: string;
9
+ keywords: string;
10
+ handleMousedown(event: Event): void;
11
+ constructor(elementRef: ElementRef);
12
+ ngOnInit(): void;
13
+ abstract getSearchResult(keywords: string): void;
14
+ abstract selectMention<T>(event: T): void;
15
+ static ɵfac: i0.ɵɵFactoryDeclaration<TheBaseSuggestion, never>;
16
+ static ɵdir: i0.ɵɵDirectiveDeclaration<TheBaseSuggestion, never, never, { "editor": "editor"; "type": "type"; "keywords": "keywords"; }, {}, never, never, false>;
17
+ }
@@ -5,11 +5,12 @@ export * from './color/color.editor';
5
5
  export * from './heading/heading.editor';
6
6
  export * from './hr/hr.editor';
7
7
  export * from './image/image.editor';
8
+ export * from './indent/indent.editor';
9
+ export * from './link/link.editor';
8
10
  export * from './list/list.editor';
9
11
  export * from './mark/mark.editor';
12
+ export * from './mention/index';
13
+ export * from './quick-insert/quick-insert.editor';
10
14
  export * from './table/table.editor';
11
15
  export * from './todo-item/todo-item.editor';
12
16
  export * from './vertical-align/vertical-align.editor';
13
- export * from './link/link.editor';
14
- export * from './quick-insert/quick-insert.editor';
15
- export * from './indent/indent.editor';
package/utils/common.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export declare const IS_MAC: boolean;
2
2
  export declare const CONTROL_KEY: string;
3
+ export declare const isDirectionKeydown: (event: KeyboardEvent) => boolean;
@@ -1,5 +1,7 @@
1
1
  import { ThyPopoverRef } from 'ngx-tethys/popover';
2
- import { Editor } from 'slate';
2
+ import { Editor, Point } from 'slate';
3
3
  export declare const THE_EDITOR_UUID: WeakMap<import("@worktile/theia").TheEditor, string>;
4
4
  export declare const THE_EDITOR_CONVERSION_HINT_REF: WeakMap<Editor, ThyPopoverRef<any>>;
5
5
  export declare const THE_EDITOR_QUICK_TOOLBAR_REF: WeakMap<Editor, ThyPopoverRef<any>>;
6
+ export declare const THE_EDITOR_ORIGIN_ANCHOR: WeakMap<Editor, Point>;
7
+ export declare const THE_EDITOR_POPOVER_REF: WeakMap<Editor, ThyPopoverRef<any>>;