@worktile/theia 2.5.2 → 3.0.0-next.2
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/bundles/worktile-theia.umd.js +4947 -4554
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/constants/toolbar.d.ts +0 -1
- package/core/create-plugin.d.ts +2 -0
- package/core/create-toolbar.d.ts +5 -0
- package/core/index.d.ts +4 -0
- package/core/utils/flatten-deep-plugins.d.ts +6 -0
- package/core/utils/get-plugin-options.d.ts +2 -0
- package/core/utils/get-plugin.d.ts +2 -0
- package/core/utils/get-plugins-by-key.d.ts +2 -0
- package/core/utils/get-plugins.d.ts +2 -0
- package/core/utils/index.d.ts +7 -0
- package/core/utils/merge-options.d.ts +2 -0
- package/core/utils/override-plugins-by-key.d.ts +5 -0
- package/core/with-theia.d.ts +4 -0
- package/editor.component.d.ts +4 -6
- package/editor.module.d.ts +2 -2
- package/esm2015/components/toolbar-item/toolbar-item.component.js +1 -1
- package/esm2015/constants/toolbar.js +1 -2
- package/esm2015/core/create-plugin.js +6 -0
- package/esm2015/core/create-toolbar.js +57 -0
- package/esm2015/core/index.js +5 -0
- package/esm2015/core/utils/flatten-deep-plugins.js +36 -0
- package/esm2015/core/utils/get-plugin-options.js +3 -0
- package/esm2015/core/utils/get-plugin.js +3 -0
- package/esm2015/core/utils/get-plugins-by-key.js +8 -0
- package/esm2015/core/utils/get-plugins.js +5 -0
- package/esm2015/core/utils/index.js +8 -0
- package/esm2015/core/utils/merge-options.js +15 -0
- package/esm2015/core/utils/override-plugins-by-key.js +27 -0
- package/esm2015/core/with-theia.js +36 -0
- package/esm2015/editor.component.js +27 -40
- package/esm2015/interfaces/editor.js +2 -2
- package/esm2015/interfaces/index.js +3 -1
- package/esm2015/interfaces/plugins/index.js +5 -0
- package/esm2015/interfaces/plugins/no-infer.js +2 -0
- package/esm2015/interfaces/plugins/plugin-key.js +40 -0
- package/esm2015/interfaces/plugins/plugins.js +2 -0
- package/esm2015/interfaces/plugins/with-override.js +2 -0
- package/esm2015/interfaces/toolbar.js +1 -1
- package/esm2015/interfaces/utility/index.js +4 -0
- package/esm2015/interfaces/utility/nested-structure-by-key.js +2 -0
- package/esm2015/interfaces/utility/override-by-key.js +2 -0
- package/esm2015/interfaces/utility/types.js +2 -0
- package/esm2015/plugins/align/align.editor.js +3 -3
- package/esm2015/plugins/align/align.plugin.js +41 -2
- package/esm2015/plugins/autoformat/autoformat.plugin.js +19 -13
- package/esm2015/plugins/blockquote/blockquote.editor.js +9 -16
- package/esm2015/plugins/blockquote/blockquote.plugin.js +23 -4
- package/esm2015/plugins/code/code.editor.js +4 -15
- package/esm2015/plugins/code/code.plugin.js +22 -2
- package/esm2015/plugins/color/color.plugin.js +25 -0
- package/esm2015/plugins/common/auto-insert-data..js +14 -9
- package/esm2015/plugins/common/block-card.plugin.js +9 -3
- package/esm2015/plugins/common/get-fragment.plugin.js +10 -2
- package/esm2015/plugins/common/history.plugin.js +7 -1
- package/esm2015/plugins/common/move-selection.plugin.js +9 -3
- package/esm2015/plugins/common/remove-empty.plugin.js +7 -1
- package/esm2015/plugins/common/remove-void.plugin.js +8 -2
- package/esm2015/plugins/common/reset-type.plugin.js +7 -1
- package/esm2015/plugins/common/transforms.plugin.js +8 -2
- package/esm2015/plugins/deserializers/deserialize-html.plugin.js +10 -5
- package/esm2015/plugins/deserializers/deserialize-md.plugin.js +11 -5
- package/esm2015/plugins/font-size/font-size.editor.js +29 -3
- package/esm2015/plugins/heading/heading.editor.js +22 -4
- package/esm2015/plugins/heading/heading.plugin.js +60 -2
- package/esm2015/plugins/hr/hr.plugin.js +21 -1
- package/esm2015/plugins/image/image.plugin.js +24 -3
- package/esm2015/plugins/indent/indent.editor.js +18 -16
- package/esm2015/plugins/indent/indent.plugin.js +50 -9
- package/esm2015/plugins/index.js +70 -126
- package/esm2015/plugins/inline-code/inline-code.plugin.js +19 -2
- package/esm2015/plugins/link/link.plugin.js +21 -7
- package/esm2015/plugins/list/list.editor.js +3 -3
- package/esm2015/plugins/list/list.plugin.js +46 -3
- package/esm2015/plugins/mark/mark.plugin.js +44 -2
- package/esm2015/plugins/node-id/node-id.plugin.js +21 -5
- package/esm2015/plugins/normalizers/insert-paragraph-nodes.js +10 -2
- package/esm2015/plugins/normalizers/remove-empty-nodes.js +1 -1
- package/esm2015/plugins/normalizers/trailing-node.plugin.js +27 -18
- package/esm2015/plugins/paint-format/paint-format.editor.js +60 -4
- package/esm2015/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.js +7 -4
- package/esm2015/plugins/quick-insert/quick-insert.editor.js +4 -4
- package/esm2015/plugins/quick-insert/quick-insert.plugin.js +23 -16
- package/esm2015/plugins/soft-break/soft-break.plugin.js +22 -3
- package/esm2015/plugins/table/components/table.component.js +4 -5
- package/esm2015/plugins/table/table.plugin.js +26 -7
- package/esm2015/plugins/table/transforms/insert-table.js +2 -2
- package/esm2015/plugins/todo-item/todo-item.editor.js +4 -4
- package/esm2015/plugins/todo-item/todo-item.plugin.js +21 -2
- package/esm2015/plugins/vertical-align/vertical-align.editor.js +40 -1
- package/esm2015/public-api.js +2 -1
- package/esm2015/queries/index.js +3 -5
- package/esm2015/queries/is-contain-nested-type.js +29 -0
- package/esm2015/transforms/insert-element-next.js +11 -11
- package/esm2015/transforms/insert-element.js +1 -1
- package/esm2015/utils/index.js +5 -1
- package/fesm2015/worktile-theia.js +6624 -6253
- package/fesm2015/worktile-theia.js.map +1 -1
- package/interfaces/editor.d.ts +14 -12
- package/interfaces/index.d.ts +2 -0
- package/interfaces/plugins/index.d.ts +4 -0
- package/interfaces/plugins/no-infer.d.ts +1 -0
- package/interfaces/plugins/plugin-key.d.ts +48 -0
- package/interfaces/plugins/plugins.d.ts +39 -0
- package/interfaces/plugins/with-override.d.ts +7 -0
- package/interfaces/toolbar.d.ts +0 -1
- package/interfaces/utility/index.d.ts +3 -0
- package/interfaces/utility/nested-structure-by-key.d.ts +3 -0
- package/interfaces/utility/override-by-key.d.ts +3 -0
- package/interfaces/utility/types.d.ts +1 -0
- package/package.json +1 -1
- package/plugins/align/align.editor.d.ts +1 -1
- package/plugins/align/align.plugin.d.ts +2 -1
- package/plugins/autoformat/autoformat.plugin.d.ts +2 -1
- package/plugins/blockquote/blockquote.plugin.d.ts +2 -2
- package/plugins/code/code.plugin.d.ts +2 -2
- package/plugins/color/color.plugin.d.ts +1 -0
- package/plugins/common/auto-insert-data..d.ts +2 -3
- package/plugins/common/block-card.plugin.d.ts +2 -2
- package/plugins/common/get-fragment.plugin.d.ts +5 -1
- package/plugins/common/history.plugin.d.ts +4 -3
- package/plugins/common/move-selection.plugin.d.ts +2 -2
- package/plugins/common/remove-empty.plugin.d.ts +2 -2
- package/plugins/common/remove-void.plugin.d.ts +2 -1
- package/plugins/common/reset-type.plugin.d.ts +2 -2
- package/plugins/common/transforms.plugin.d.ts +2 -1
- package/plugins/deserializers/deserialize-html.plugin.d.ts +2 -2
- package/plugins/deserializers/deserialize-md.plugin.d.ts +2 -2
- package/plugins/font-size/font-size.editor.d.ts +3 -2
- package/plugins/heading/heading.editor.d.ts +4 -1
- package/plugins/heading/heading.plugin.d.ts +7 -2
- package/plugins/hr/hr.plugin.d.ts +2 -2
- package/plugins/image/image.plugin.d.ts +7 -2
- package/plugins/indent/indent.editor.d.ts +2 -2
- package/plugins/indent/indent.plugin.d.ts +7 -3
- package/plugins/index.d.ts +1 -5
- package/plugins/inline-code/inline-code.plugin.d.ts +2 -2
- package/plugins/link/link.plugin.d.ts +2 -2
- package/plugins/list/list.plugin.d.ts +2 -2
- package/plugins/mark/mark.plugin.d.ts +2 -1
- package/plugins/node-id/node-id.plugin.d.ts +2 -3
- package/plugins/normalizers/insert-paragraph-nodes.d.ts +6 -2
- package/plugins/normalizers/trailing-node.plugin.d.ts +2 -1
- package/plugins/paint-format/paint-format.editor.d.ts +1 -0
- package/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.d.ts +2 -3
- package/plugins/quick-insert/quick-insert.editor.d.ts +1 -1
- package/plugins/quick-insert/quick-insert.plugin.d.ts +5 -1
- package/plugins/soft-break/soft-break.plugin.d.ts +3 -2
- package/plugins/table/components/table.component.d.ts +2 -2
- package/plugins/table/table.plugin.d.ts +2 -2
- package/plugins/todo-item/todo-item.plugin.d.ts +2 -2
- package/plugins/vertical-align/vertical-align.editor.d.ts +1 -0
- package/public-api.d.ts +1 -0
- package/queries/index.d.ts +2 -4
- package/queries/is-contain-nested-type.d.ts +2 -0
- package/transforms/insert-element-next.d.ts +1 -1
- package/utils/index.d.ts +4 -0
- package/esm2015/plugins/align/options.js +0 -37
- package/esm2015/plugins/blockquote/options.js +0 -13
- package/esm2015/plugins/code/options.js +0 -13
- package/esm2015/plugins/color/options.js +0 -20
- package/esm2015/plugins/font-size/options.js +0 -25
- package/esm2015/plugins/heading/options.js +0 -54
- package/esm2015/plugins/hr/options.js +0 -13
- package/esm2015/plugins/image/options.js +0 -12
- package/esm2015/plugins/indent/options.js +0 -28
- package/esm2015/plugins/inline-code/options.js +0 -14
- package/esm2015/plugins/link/options.js +0 -12
- package/esm2015/plugins/list/options.js +0 -19
- package/esm2015/plugins/mark/options.js +0 -37
- package/esm2015/plugins/paint-format/options.js +0 -57
- package/esm2015/plugins/table/options.js +0 -14
- package/esm2015/plugins/todo-item/options.js +0 -12
- package/esm2015/plugins/vertical-align/options.js +0 -39
- package/esm2015/queries/anchor-inline.js +0 -5
- package/esm2015/queries/get-children.js +0 -14
- package/esm2015/queries/is-empty-content.js +0 -15
- package/plugins/align/options.d.ts +0 -2
- package/plugins/blockquote/options.d.ts +0 -2
- package/plugins/code/options.d.ts +0 -2
- package/plugins/color/options.d.ts +0 -2
- package/plugins/font-size/options.d.ts +0 -2
- package/plugins/heading/options.d.ts +0 -2
- package/plugins/hr/options.d.ts +0 -2
- package/plugins/image/options.d.ts +0 -2
- package/plugins/indent/options.d.ts +0 -2
- package/plugins/inline-code/options.d.ts +0 -2
- package/plugins/link/options.d.ts +0 -2
- package/plugins/list/options.d.ts +0 -2
- package/plugins/mark/options.d.ts +0 -2
- package/plugins/paint-format/options.d.ts +0 -2
- package/plugins/table/options.d.ts +0 -2
- package/plugins/todo-item/options.d.ts +0 -2
- package/plugins/vertical-align/options.d.ts +0 -2
- package/queries/anchor-inline.d.ts +0 -2
- package/queries/get-children.d.ts +0 -6
- package/queries/is-empty-content.d.ts +0 -2
package/interfaces/editor.d.ts
CHANGED
|
@@ -1,23 +1,28 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
1
2
|
import { Ancestor, Range, Path, Point, Node, Span, NodeEntry, Editor, Element, Text } from 'slate';
|
|
2
3
|
import { AngularEditor, SlatePlaceholder, ViewType } from 'slate-angular';
|
|
3
4
|
import { HistoryEditor } from 'slate-history';
|
|
4
5
|
import { ElementOptionsInfo } from './valid-children-types';
|
|
5
6
|
import { Predicate } from '../utils/match';
|
|
6
7
|
import { ToolbarOption } from './toolbar';
|
|
7
|
-
import { ElementKinds, FontSizes } from '../constants/node-types';
|
|
8
|
-
import { AutoFormatRule } from './auto-format';
|
|
9
8
|
import { CustomElementKinds } from '../custom-types';
|
|
10
|
-
import {
|
|
9
|
+
import { ElementKinds, FontSizes } from '../constants';
|
|
10
|
+
import { ThePlugin } from './plugins';
|
|
11
|
+
import { AutoFormatRule } from './auto-format';
|
|
12
|
+
import { OverrideByKey, NestedStructureByKey } from './utility';
|
|
11
13
|
export interface TheEditor extends AngularEditor, HistoryEditor {
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
options: TheOptions;
|
|
16
|
+
plugins: ThePlugin[];
|
|
17
|
+
disabled: boolean;
|
|
18
|
+
pluginsByKey: OverrideByKey;
|
|
19
|
+
nestedStructureByKey: NestedStructureByKey;
|
|
20
|
+
extraElementOptions: ElementOptionsInfo[];
|
|
21
|
+
extraAutoFormatRules: AutoFormatRule[];
|
|
12
22
|
renderElement: (element: Element) => ViewType;
|
|
13
23
|
renderLeaf: (text: Text) => ViewType;
|
|
14
|
-
insertElement: (
|
|
24
|
+
insertElement: (nodes: Node | Node[]) => void;
|
|
15
25
|
isContainer: (element: Element) => boolean;
|
|
16
|
-
extraElementOptions: ElementOptionsInfo[];
|
|
17
|
-
extraAutoFormatRules: AutoFormatRule[];
|
|
18
|
-
options: TheOptions;
|
|
19
|
-
disabled: boolean;
|
|
20
|
-
[key: string]: any;
|
|
21
26
|
}
|
|
22
27
|
export declare const TheEditor: {
|
|
23
28
|
getWindow(editor: AngularEditor): Window;
|
|
@@ -63,9 +68,6 @@ export declare const TheEditor: {
|
|
|
63
68
|
}): void;
|
|
64
69
|
hasRange(editor: AngularEditor, range: import("slate").BaseRange): boolean;
|
|
65
70
|
};
|
|
66
|
-
export interface ThePlugin {
|
|
67
|
-
(editor: Editor): Editor;
|
|
68
|
-
}
|
|
69
71
|
export declare enum TheDataMode {
|
|
70
72
|
json = "json",
|
|
71
73
|
html = "html"
|
package/interfaces/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type NoInfer<T> = [T][T extends any ? 0 : never];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export declare enum PluginKeys {
|
|
2
|
+
list = "list",
|
|
3
|
+
numberedList = "numbered-list",
|
|
4
|
+
bulletedList = "bulleted-list",
|
|
5
|
+
checkItem = "check-item",
|
|
6
|
+
link = "link",
|
|
7
|
+
blockCard = "block-card",
|
|
8
|
+
indent = "indent",
|
|
9
|
+
table = "table",
|
|
10
|
+
image = "image",
|
|
11
|
+
code = "code",
|
|
12
|
+
heading = "heading",
|
|
13
|
+
blockquote = "block-quote",
|
|
14
|
+
inlineCode = "inline-code",
|
|
15
|
+
color = "select-color",
|
|
16
|
+
fontSize = "font-size",
|
|
17
|
+
mark = "mark",
|
|
18
|
+
hr = "hr",
|
|
19
|
+
align = "align",
|
|
20
|
+
verticalAlign = "vertical-align",
|
|
21
|
+
softBreak = "soft-break",
|
|
22
|
+
nodeID = "node-id",
|
|
23
|
+
resetType = "reset-type",
|
|
24
|
+
removeVoid = "remove-void",
|
|
25
|
+
removeEmpty = "remove-empty",
|
|
26
|
+
theHistory = "the-history",
|
|
27
|
+
autoInsertData = "auto-insert-data",
|
|
28
|
+
autoFormat = "auto-format",
|
|
29
|
+
transforms = "transforms",
|
|
30
|
+
moveSelection = "move-selection",
|
|
31
|
+
trailingNode = "trailing-node",
|
|
32
|
+
insertParagraphNodes = "insert-paragraph-nodes",
|
|
33
|
+
getFragment = "get-fragment",
|
|
34
|
+
deserializeHtml = "deserialize-html",
|
|
35
|
+
deserializeMd = "deserialize-md",
|
|
36
|
+
quickInsert = "quick-insert",
|
|
37
|
+
paintFormat = "paint-format"
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 通过 key 存储插件的唯一 key。
|
|
41
|
+
*/
|
|
42
|
+
export declare type PluginKey = PluginKeys | string;
|
|
43
|
+
export interface TheiaPluginKey {
|
|
44
|
+
/**
|
|
45
|
+
* 用于在 `editor.pluginsByKey` 中按键存储插件的属性。
|
|
46
|
+
*/
|
|
47
|
+
key?: PluginKey;
|
|
48
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CustomElementKinds } from '../../custom-types';
|
|
2
|
+
import { ToolbarItem } from '../toolbar';
|
|
3
|
+
import { NestedStructureByKey } from '../utility';
|
|
4
|
+
import { WithRequired } from '../utility/types';
|
|
5
|
+
import { NoInfer } from './no-infer';
|
|
6
|
+
import { PluginKey, TheiaPluginKey } from './plugin-key';
|
|
7
|
+
import { WithOverride } from './with-override';
|
|
8
|
+
export declare type ThePluginOption<P> = NoInfer<{
|
|
9
|
+
allowParentTypes?: (CustomElementKinds | string)[];
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}> & P;
|
|
12
|
+
export declare type ThePlugin<T = {}, P = {}> = Required<TheiaPluginKey> & {
|
|
13
|
+
/**
|
|
14
|
+
* toolbar
|
|
15
|
+
*/
|
|
16
|
+
toolbarItems?: ToolbarItem[];
|
|
17
|
+
/**
|
|
18
|
+
* 插件使用的扩展属性
|
|
19
|
+
*/
|
|
20
|
+
options?: ThePluginOption<P>;
|
|
21
|
+
/**
|
|
22
|
+
* 插件嵌套结构
|
|
23
|
+
*/
|
|
24
|
+
nestedStructureByKey?: NestedStructureByKey;
|
|
25
|
+
/**
|
|
26
|
+
* 用于通过 key 深度覆盖插件
|
|
27
|
+
*/
|
|
28
|
+
overrideByKey?: Record<PluginKey, Partial<ThePlugin<T>>>;
|
|
29
|
+
/**
|
|
30
|
+
* Editor method overriders.
|
|
31
|
+
*/
|
|
32
|
+
withOverrides?: WithOverride<T, P>;
|
|
33
|
+
/**
|
|
34
|
+
* 递归插件支持允许在单个插件中包含多个插件。
|
|
35
|
+
* 最终将所有插件扁平化到编辑器中。
|
|
36
|
+
*/
|
|
37
|
+
plugins?: ThePlugin<T>[];
|
|
38
|
+
};
|
|
39
|
+
export declare type WithThePlugin<T = {}, P = {}> = WithRequired<ThePlugin<T, P>, 'options'>;
|
package/interfaces/toolbar.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare type WithRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
|
-
import { Alignment } from '../../constants
|
|
2
|
+
import { Alignment } from '../../constants';
|
|
3
3
|
export declare const AlignEditor: {
|
|
4
4
|
isActive(editor: Editor, alignment: Alignment): boolean;
|
|
5
5
|
isDisabled(editor: Editor): boolean;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const withAlign: <T extends import("
|
|
1
|
+
export declare const withAlign: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
2
|
+
export declare const createAlignPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const withAutoFormat:
|
|
1
|
+
export declare const withAutoFormat: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
2
|
+
export declare const createAutoFormatPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const withBlockquote: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
2
|
+
export declare const createBlockquotePlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const withCode: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
2
|
+
export declare const createCodePlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createColorPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const withAutoInsertData: (validChildren?: ElementOptionsInfo[]) => (editor: Editor) => import("../../interfaces").TheEditor;
|
|
1
|
+
export declare const withAutoInsertData: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
2
|
+
export declare const createAutoInsertDataPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const withBlockCard: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
2
|
+
export declare const createBlockCardPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
import { CustomElementKinds } from '../../custom-types';
|
|
2
|
-
export
|
|
2
|
+
export interface GetFragmentPluginOptions {
|
|
3
|
+
types?: CustomElementKinds[];
|
|
4
|
+
}
|
|
5
|
+
export declare const withGetFragment: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
6
|
+
export declare const createGetFragmentPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, GetFragmentPluginOptions>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, GetFragmentPluginOptions>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
|
-
export declare const UNDOING: WeakMap<import("
|
|
3
|
-
export declare const REDOING: WeakMap<import("
|
|
4
|
-
export declare const withTheHistory: (editor:
|
|
2
|
+
export declare const UNDOING: WeakMap<import("../../interfaces").TheEditor, boolean>;
|
|
3
|
+
export declare const REDOING: WeakMap<import("../../interfaces").TheEditor, boolean>;
|
|
4
|
+
export declare const withTheHistory: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
5
5
|
export declare const TheHistoryEditor: {
|
|
6
6
|
isUndoing(editor: Editor): boolean | undefined;
|
|
7
7
|
isRedoing(editor: Editor): boolean | undefined;
|
|
8
8
|
};
|
|
9
|
+
export declare const createTheHistoryPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const withMoveSelection: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
2
|
+
export declare const createMoveSelectionPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const withRemoveEmpty: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
2
|
+
export declare const createRemoveEmptyPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export declare const withRemoveVoid: <T extends import("
|
|
1
|
+
export declare const withRemoveVoid: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
2
|
+
export declare const createRemoveVoidPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const withResetType: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
2
|
+
export declare const createResetTypePlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -3,5 +3,6 @@ declare type Params = Parameters<typeof Transforms.insertNodes>;
|
|
|
3
3
|
export interface TransformEditor {
|
|
4
4
|
insertNodes: (nodes: Params[1], options?: Params[2]) => void;
|
|
5
5
|
}
|
|
6
|
-
export declare const withTransforms:
|
|
6
|
+
export declare const withTransforms: <T extends import("../../interfaces").TheEditor>(editor: T) => T & TransformEditor;
|
|
7
|
+
export declare const createTransformsPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
7
8
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
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,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const withDeserializeMd: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
2
|
+
export declare const createDeserializeMdPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { FontSizes } from '../../constants';
|
|
3
|
+
import { TheEditor } from '../../interfaces';
|
|
4
4
|
export declare const FontSizeEditor: {
|
|
5
5
|
setFontSize(editor: TheEditor, size: FontSizes): void;
|
|
6
6
|
setFontSizeMark(editor: Editor, size: FontSizes): void;
|
|
@@ -8,3 +8,4 @@ export declare const FontSizeEditor: {
|
|
|
8
8
|
isFontSizeActive(editor: Editor, size: FontSizes): boolean;
|
|
9
9
|
isDisabled(editor: TheEditor): boolean;
|
|
10
10
|
};
|
|
11
|
+
export declare const createFontSizePlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
|
-
import { HeadingElementKinds } from '../../interfaces
|
|
2
|
+
import { HeadingElementKinds, ThePlugin } from '../../interfaces';
|
|
3
|
+
import type { HeadingPluginOptions } from './heading.plugin';
|
|
4
|
+
export declare const headingOptions: HeadingPluginOptions;
|
|
3
5
|
export declare const HeadingEditor: {
|
|
4
6
|
setHeading(editor: Editor, heading: HeadingElementKinds): void;
|
|
5
7
|
isHeadingActive(editor: Editor, heading: HeadingElementKinds): boolean;
|
|
8
|
+
headingPlugins(): ThePlugin<{}, {}>[];
|
|
6
9
|
};
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import { CustomElementKinds } from '../../custom-types';
|
|
2
|
+
export interface HeadingPluginOptions {
|
|
3
|
+
allowParentTypes?: string[];
|
|
4
|
+
cleanupTypes: CustomElementKinds[];
|
|
5
|
+
}
|
|
6
|
+
export declare const withHeading: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
7
|
+
export declare const createHeadingPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, HeadingPluginOptions>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, HeadingPluginOptions>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const withHr: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
2
|
+
export declare const createHrPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export
|
|
1
|
+
import { CustomElementKinds } from '../../custom-types';
|
|
2
|
+
export interface ImagePluginOptions {
|
|
3
|
+
allowParentTypes?: CustomElementKinds[];
|
|
4
|
+
imageTypes?: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare const withImage: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
7
|
+
export declare const createImagePlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, ImagePluginOptions>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, ImagePluginOptions>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Editor, Element } from 'slate';
|
|
2
|
-
import { TheEditor } from '../../interfaces
|
|
2
|
+
import { TheEditor } from '../../interfaces';
|
|
3
3
|
import { CustomElementKinds } from '../../custom-types';
|
|
4
|
-
export declare const includesIndentTypes: CustomElementKinds[];
|
|
5
4
|
export declare const IndentEditor: {
|
|
5
|
+
getAllowedTypes(editor: TheEditor): (import("@worktile/theia").ElementKinds.image | import("@worktile/theia").ElementKinds.paragraph | import("@worktile/theia").ElementKinds.heading_1 | import("@worktile/theia").ElementKinds.heading_2 | import("@worktile/theia").ElementKinds.heading_3 | import("@worktile/theia").ElementKinds.heading_4 | import("@worktile/theia").ElementKinds.heading_5 | import("@worktile/theia").ElementKinds.heading_6 | import("@worktile/theia").ElementKinds.numberedList | import("@worktile/theia").ElementKinds.bulletedList | import("@worktile/theia").ElementKinds.listItem | import("@worktile/theia").ElementKinds.checkItem | import("@worktile/theia").ElementKinds.table | import("@worktile/theia").ElementKinds.tableRow | import("@worktile/theia").ElementKinds.tableCell | import("@worktile/theia").ElementKinds.code | import("@worktile/theia").ElementKinds.blockquote | import("@worktile/theia").ElementKinds.hr | import("@worktile/theia").ElementKinds.link | import("@worktile/theia").ElementKinds.inlineCode)[];
|
|
6
6
|
setIndent(editor: TheEditor): void;
|
|
7
7
|
cancelIndent(editor: Editor): void;
|
|
8
8
|
setTextIndent(editor: TheEditor, kinds: CustomElementKinds[], textIndent: number): void;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { CustomElementKinds } from '../../custom-types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
export interface IndentPluginOptions {
|
|
3
|
+
maxIndent?: number;
|
|
4
|
+
allowedTypes?: CustomElementKinds[];
|
|
5
|
+
disableIndentTypes?: CustomElementKinds[];
|
|
6
|
+
}
|
|
7
|
+
export declare const withIndent: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
8
|
+
export declare const createIndentPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, IndentPluginOptions>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, IndentPluginOptions>;
|
package/plugins/index.d.ts
CHANGED
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { TheEditor, ThePlugin, ToolbarItem } from '../interfaces';
|
|
3
|
-
import { HistoryEditor } from 'slate-history';
|
|
4
|
-
export declare const toolbarCompose: (toolbarItems?: ToolbarItem[]) => ToolbarItem[];
|
|
5
|
-
export declare const withTheEditor: <T extends AngularEditor & HistoryEditor>(plugins: ThePlugin[], editor: T) => T & TheEditor;
|
|
1
|
+
export declare const internalPlugins: import("@worktile/theia").ThePlugin<{}, {}>[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const withInlineCode: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
2
|
+
export declare const createInlineCodePlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const withLink: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
2
|
+
export declare const createLinkPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Editor } from 'slate';
|
|
2
1
|
import { WithListOptions } from './types';
|
|
3
|
-
export declare const withList:
|
|
2
|
+
export declare const withList: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
3
|
+
export declare const createListPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, WithListOptions>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, WithListOptions>;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { MarkEditor } from './mark.editor';
|
|
2
|
-
export declare const withMark:
|
|
2
|
+
export declare const withMark: <T extends import("../../interfaces").TheEditor & MarkEditor>(editor: T) => T;
|
|
3
|
+
export declare const createMarkPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -4,6 +4,5 @@ export interface WithNodeIDProps extends QueryOptions {
|
|
|
4
4
|
idCreator?: () => void;
|
|
5
5
|
filterText?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export declare const withNodeID:
|
|
8
|
-
|
|
9
|
-
};
|
|
7
|
+
export declare const withNodeID: <T extends import("../../interfaces").TheEditor>(e: T) => T;
|
|
8
|
+
export declare const createNodeIDPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, WithNodeIDProps>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, WithNodeIDProps>;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
import { TransformEditor } from '../common/transforms.plugin';
|
|
2
1
|
import { CustomElementKinds } from '../../custom-types';
|
|
3
|
-
|
|
2
|
+
import { TransformEditor } from '../common/transforms.plugin';
|
|
3
|
+
export interface InsertParagraphNodesOptions {
|
|
4
|
+
types: CustomElementKinds[];
|
|
5
|
+
}
|
|
6
|
+
export declare const withInsertParagraphNodes: <T extends import("../../interfaces").TheEditor & TransformEditor>(editor: T) => T;
|
|
7
|
+
export declare const createInsertParagraphNodesPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, InsertParagraphNodesOptions>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, InsertParagraphNodesOptions>;
|
|
@@ -5,4 +5,5 @@ export interface WithTrailingNode extends QueryOptions {
|
|
|
5
5
|
type?: CustomElementKinds;
|
|
6
6
|
level?: number;
|
|
7
7
|
}
|
|
8
|
-
export declare const withTrailingNode:
|
|
8
|
+
export declare const withTrailingNode: <T extends import("../../interfaces").TheEditor & TransformEditor>(editor: T) => T;
|
|
9
|
+
export declare const createTrailingNodePlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -5,3 +5,4 @@ export declare const PaintFormatEditor: {
|
|
|
5
5
|
enableFormatBrush(editor: TheEditor): void;
|
|
6
6
|
cancelFormatBrushStatus(editor: TheEditor): void;
|
|
7
7
|
};
|
|
8
|
+
export declare const createPaintFormatPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { OnInit, OnDestroy, ElementRef, ChangeDetectorRef } from '@angular/core';
|
|
2
2
|
import { MixinBase } from 'ngx-tethys/core';
|
|
3
3
|
import { Editor } from 'slate';
|
|
4
|
-
import { ToolbarItem } from '../../../../interfaces
|
|
5
|
-
import { ToolbarActionTypes } from '../../../../constants
|
|
6
|
-
import { ToolbarItemMode } from '../../../../constants/toolbar';
|
|
4
|
+
import { ToolbarItem } from '../../../../interfaces';
|
|
5
|
+
import { ToolbarActionTypes, ToolbarItemMode } from '../../../../constants';
|
|
7
6
|
import * as i0 from "@angular/core";
|
|
8
7
|
declare const TheQuickToolbarComponent_base: import("ngx-tethys/core").Constructor<import("ngx-tethys/core").ThyUnsubscribe> & typeof MixinBase;
|
|
9
8
|
export declare class TheQuickToolbarComponent extends TheQuickToolbarComponent_base implements OnInit, OnDestroy {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
|
-
import { ToolbarItem } from '../../interfaces
|
|
2
|
+
import { ToolbarItem } from '../../interfaces';
|
|
3
3
|
export declare const QuickInsertEditor: {
|
|
4
4
|
openQuickInsertToolbar(editor: Editor, quickToolbarItems: ToolbarItem[], origin?: HTMLElement): void;
|
|
5
5
|
closeQuickInsertToolbar(editor: Editor): void;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
2
|
import { ElementKinds } from '../../constants';
|
|
3
|
-
export
|
|
3
|
+
export interface QuickInsertPluginOptions {
|
|
4
|
+
hotKey?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare const withQuickInsert: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
7
|
+
export declare const createQuickInsertPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, QuickInsertPluginOptions>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, QuickInsertPluginOptions>;
|
|
4
8
|
export declare const allowOpenQuickToolbar: (editor: Editor, allowTypes: ElementKinds[]) => boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { TheEditor } from '../../interfaces';
|
|
1
2
|
import { TransformEditor } from '../common/transforms.plugin';
|
|
2
3
|
import { SoftBreakOnKeyDownOptions } from './soft-break.types';
|
|
3
|
-
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const withSoftBreak: <T extends TheEditor & TransformEditor>(editor: T) => T;
|
|
5
|
+
export declare const createSoftBreakPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, SoftBreakOnKeyDownOptions>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, SoftBreakOnKeyDownOptions>;
|
|
@@ -71,8 +71,8 @@ export declare class TheTableComponent extends TheBaseElementComponent<TableElem
|
|
|
71
71
|
onRowMouseDown(event: MouseEvent, index: number): void;
|
|
72
72
|
onSelectTable(event: MouseEvent): void;
|
|
73
73
|
listenTableContextMenuEvent(): void;
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
trackByFnRowCotrols(index: number): number;
|
|
75
|
+
trackByFnColCotrols(index: number): number;
|
|
76
76
|
ngOnDestroy(): void;
|
|
77
77
|
static ɵfac: i0.ɵɵFactoryDeclaration<TheTableComponent, never>;
|
|
78
78
|
static ɵcmp: i0.ɵɵComponentDeclaration<TheTableComponent, "the-table, [theTable]", never, {}, {}, never, never>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Editor } from 'slate';
|
|
2
1
|
import { TheEditor } from '../../interfaces';
|
|
3
|
-
export declare const withTable: (editor:
|
|
2
|
+
export declare const withTable: <T extends TheEditor>(editor: T) => T;
|
|
3
|
+
export declare const createTablePlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const
|
|
1
|
+
export declare const withTodoItem: <T extends import("../../interfaces").TheEditor>(editor: T) => T;
|
|
2
|
+
export declare const createTodoItemPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|
|
@@ -4,3 +4,4 @@ export declare const VerticalAlignEditor: {
|
|
|
4
4
|
isVerticalActive(editor: TheEditor, alignment: VerticalAlignment): boolean;
|
|
5
5
|
setVerticalAlign(editor: TheEditor, alignment: VerticalAlignment): void;
|
|
6
6
|
};
|
|
7
|
+
export declare const createVerticalAlignPlugin: <T = {}>(override?: Partial<import("../../interfaces").ThePlugin<T, {}>>, overrideByKey?: import("../../interfaces").OverrideByKey) => import("../../interfaces").ThePlugin<T, {}>;
|