@worktile/theia 1.2.6 → 1.2.10
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 +1151 -478
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/components/inline-toolbar/inline-toolbar.component.d.ts +24 -0
- package/components/inline-toolbar/inline-toolbar.component.scss +18 -0
- package/components/nav-split-line/nav-split-line.component.d.ts +6 -1
- package/components/toolbar-dropdown/toolbar-dropdown.component.scss +3 -0
- package/components/toolbar-item/toolbar-item.component.d.ts +14 -5
- package/constants/code.d.ts +7 -7
- package/constants/default.d.ts +1 -1
- package/constants/node-types.d.ts +8 -8
- package/constants/toolbar.d.ts +6 -2
- package/custom-types.d.ts +5 -1
- package/editor.component.d.ts +6 -4
- package/editor.module.d.ts +59 -52
- package/esm2015/components/color-select/color-select.component.js +3 -2
- package/esm2015/components/conversion-hint/conversion-hint.component.js +2 -2
- package/esm2015/components/inline-toolbar/inline-toolbar.component.js +123 -0
- package/esm2015/components/nav-split-line/nav-split-line.component.js +26 -5
- package/esm2015/components/toolbar/toolbar.component.js +7 -9
- package/esm2015/components/toolbar-base-item/toolbar-base-item.component.js +4 -3
- package/esm2015/components/toolbar-dropdown/toolbar-dropdown.component.js +1 -1
- package/esm2015/components/toolbar-item/toolbar-item.component.js +70 -24
- package/esm2015/constants/auto-format-rules.js +2 -2
- package/esm2015/constants/code.js +7 -7
- package/esm2015/constants/default.js +2 -2
- package/esm2015/constants/node-types.js +1 -2
- package/esm2015/constants/toolbar.js +38 -5
- package/esm2015/custom-types.js +1 -1
- package/esm2015/editor.component.js +26 -21
- package/esm2015/editor.module.js +20 -8
- package/esm2015/interfaces/editor.js +2 -4
- package/esm2015/interfaces/toolbar.js +1 -1
- package/esm2015/interfaces/valid-children-types.js +8 -2
- package/esm2015/plugins/align/align.editor.js +5 -2
- package/esm2015/plugins/align/align.plugin.js +2 -2
- package/esm2015/plugins/autoformat/autoformat.plugin.js +2 -2
- package/esm2015/plugins/autoformat/transforms/auto-format-inline.js +2 -2
- package/esm2015/plugins/blockquote/blockquote.editor.js +2 -2
- package/esm2015/plugins/blockquote/blockquote.plugin.js +11 -29
- package/esm2015/plugins/blockquote/options.js +2 -2
- package/esm2015/plugins/code/code.component.js +14 -9
- package/esm2015/plugins/code/code.editor.js +2 -2
- package/esm2015/plugins/code/options.js +2 -2
- package/esm2015/plugins/color/color.editor.js +4 -1
- package/esm2015/plugins/common/auto-insert-data..js +4 -5
- package/esm2015/plugins/common/block-card.plugin.js +8 -4
- package/esm2015/plugins/common/get-fragment.plugin.js +5 -5
- package/esm2015/plugins/common/move-selection.plugin.js +2 -2
- package/esm2015/plugins/common/remove-empty.plugin.js +2 -2
- package/esm2015/plugins/common/remove-void.plugin.js +2 -2
- package/esm2015/plugins/common/reset-type.plugin.js +2 -2
- package/esm2015/plugins/deserializers/deserialize-html.plugin.js +9 -2
- package/esm2015/plugins/deserializers/deserialize-md.plugin.js +2 -2
- package/esm2015/plugins/heading/heading.plugin.js +2 -2
- package/esm2015/plugins/heading/options.js +2 -2
- package/esm2015/plugins/hr/hr.editor.js +2 -2
- package/esm2015/plugins/hr/options.js +2 -2
- package/esm2015/plugins/image/image.component.js +10 -10
- package/esm2015/plugins/image/image.editor.js +10 -4
- package/esm2015/plugins/image/image.plugin.js +1 -2
- package/esm2015/plugins/indent/indent.plugin.js +1 -1
- package/esm2015/plugins/indent/on-keydown-indent.js +1 -1
- package/esm2015/plugins/index.js +9 -5
- package/esm2015/plugins/link/edit/link-edit.component.js +3 -2
- package/esm2015/plugins/link/link.plugin.js +7 -2
- package/esm2015/plugins/list/list.editor.js +3 -3
- package/esm2015/plugins/list/list.plugin.js +11 -11
- package/esm2015/plugins/list/normalizers/normalize-no.js +3 -3
- package/esm2015/plugins/list/on-key-down-list.js +2 -2
- package/esm2015/plugins/list/queries/get-list-item-entry.js +2 -2
- package/esm2015/plugins/list/queries/get-start-list-item.js +9 -2
- package/esm2015/plugins/list/queries/is-in-list.js +2 -2
- package/esm2015/plugins/list/queries/is-node-type-list.js +1 -1
- package/esm2015/plugins/list/queries/is-selection-at-list-item-start.js +2 -2
- package/esm2015/plugins/list/queries/is-selection-in-same-list-item.js +17 -0
- package/esm2015/plugins/list/transforms/insert-list-data.js +2 -2
- package/esm2015/plugins/list/transforms/insert-list-item.js +2 -2
- package/esm2015/plugins/list/transforms/move-list-item-sublist-items-to-list-item-sublist.js +2 -2
- package/esm2015/plugins/list/transforms/move-list-item-sublist-items-to-list.js +2 -2
- package/esm2015/plugins/list/transforms/move-list-item-up.js +2 -2
- package/esm2015/plugins/list/transforms/unwrap-list.js +2 -2
- package/esm2015/plugins/mark/mark.editor.js +6 -2
- package/esm2015/plugins/node-id/node-id.plugin.js +9 -4
- package/esm2015/plugins/normalizers/insert-paragraph-nodes.js +2 -2
- package/esm2015/plugins/normalizers/trailing-node.plugin.js +2 -2
- package/esm2015/plugins/paint-format/options.js +54 -0
- package/esm2015/plugins/paint-format/paint-format.editor.js +67 -0
- package/esm2015/plugins/placeholder/placeholder.component.js +75 -0
- package/esm2015/plugins/public-api.js +2 -1
- package/esm2015/plugins/quick-insert/components/quick-insert.component.js +76 -0
- package/esm2015/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.js +75 -0
- package/esm2015/plugins/quick-insert/quick-insert.editor.js +61 -0
- package/esm2015/plugins/quick-insert/quick-insert.plugint.js +37 -0
- package/esm2015/plugins/table/components/row/row.component.js +3 -1
- package/esm2015/plugins/table/components/table.component.js +11 -7
- package/esm2015/plugins/table/components/td/td.component.js +2 -1
- package/esm2015/plugins/table/components/toolbar/table-toolbar.component.js +5 -4
- package/esm2015/plugins/table/table.editor.js +3 -3
- package/esm2015/plugins/table/table.plugin.js +8 -7
- package/esm2015/plugins/table/toolbar-item.component.js +3 -3
- package/esm2015/plugins/table/transforms/insert-table.js +3 -3
- package/esm2015/plugins/table/utils/calc-anchor-position.js +6 -5
- package/esm2015/plugins/table/utils/merge-cell.js +3 -3
- package/esm2015/plugins/table/utils/split-cell.js +3 -3
- package/esm2015/plugins/todo-item/todo-item.component.js +2 -2
- package/esm2015/plugins/todo-item/todo-item.editor.js +2 -2
- package/esm2015/plugins/todo-item/todo-item.plugin.js +2 -2
- package/esm2015/plugins/vertical-align/toolbar-item.component.js +12 -4
- package/esm2015/public-api.js +4 -3
- package/esm2015/queries/get-container-blocks.js +3 -3
- package/esm2015/queries/get-selection-nodes-by-type.js +1 -1
- package/esm2015/queries/index.js +2 -58
- package/esm2015/queries/is-block-active.js +1 -1
- package/esm2015/queries/is-include-types.js +1 -1
- package/esm2015/services/context.service.js +9 -2
- package/esm2015/services/toolbar.service.js +5 -5
- package/esm2015/transforms/apply-deep-to-nodes.js +2 -2
- package/esm2015/transforms/delete-element.js +2 -2
- package/esm2015/transforms/handle-continual-delete-backward.js +18 -0
- package/esm2015/transforms/handle-continual-insert-break.js +23 -0
- package/esm2015/transforms/index.js +4 -20
- package/esm2015/transforms/insert-element-next.js +2 -2
- package/esm2015/transforms/insert-elements.js +2 -2
- package/esm2015/transforms/move-children.js +2 -2
- package/esm2015/transforms/on-keydown-reset-block-type.js +2 -2
- package/esm2015/transforms/set-node.js +2 -2
- package/esm2015/transforms/split-node.js +2 -2
- package/esm2015/transforms/un-wrap.js +1 -1
- package/esm2015/utils/auto-focus.js +2 -2
- package/esm2015/utils/fragment.js +3 -3
- package/esm2015/utils/is-clean-empty-paragraph.js +32 -0
- package/esm2015/utils/weak-maps.js +2 -1
- package/fesm2015/worktile-theia.js +1195 -534
- package/fesm2015/worktile-theia.js.map +1 -1
- package/interfaces/editor.d.ts +1 -96
- package/interfaces/toolbar.d.ts +3 -2
- package/interfaces/valid-children-types.d.ts +4 -4
- package/package.json +1 -1
- package/plugins/code/code.component.d.ts +3 -2
- package/plugins/color/color.editor.d.ts +1 -1
- package/plugins/common/get-fragment.plugin.d.ts +2 -2
- package/plugins/image/image.component.d.ts +1 -0
- package/plugins/image/image.component.scss +11 -1
- package/plugins/indent/indent.plugin.d.ts +2 -2
- package/plugins/indent/on-keydown-indent.d.ts +2 -2
- package/plugins/list/queries/get-start-list-item.d.ts +8 -2
- package/plugins/list/queries/is-selection-in-same-list-item.d.ts +5 -0
- package/plugins/mark/mark.editor.d.ts +1 -1
- package/plugins/normalizers/insert-paragraph-nodes.d.ts +2 -2
- package/plugins/normalizers/trailing-node.plugin.d.ts +2 -2
- package/plugins/paint-format/options.d.ts +2 -0
- package/plugins/paint-format/paint-format.editor.d.ts +7 -0
- package/{components → plugins}/placeholder/placeholder.component.d.ts +5 -6
- package/{components → plugins}/placeholder/placeholder.component.scss +0 -0
- package/plugins/public-api.d.ts +1 -0
- package/plugins/quick-insert/components/quick-insert.component.d.ts +25 -0
- package/plugins/quick-insert/components/quick-insert.component.scss +21 -0
- package/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.d.ts +29 -0
- package/plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.scss +21 -0
- package/plugins/quick-insert/quick-insert.editor.d.ts +8 -0
- package/plugins/quick-insert/quick-insert.plugint.d.ts +2 -0
- package/plugins/table/components/table.component.d.ts +1 -0
- package/plugins/table/components/table.component.scss +1 -1
- package/plugins/table/toolbar-item.component.d.ts +1 -2
- package/plugins/table/utils/split-cell.d.ts +1 -2
- package/plugins/todo-item/todo-item.component.scss +0 -6
- package/plugins/vertical-align/toolbar-item.component.d.ts +1 -0
- package/public-api.d.ts +3 -2
- package/queries/get-container-blocks.d.ts +2 -2
- package/queries/get-selection-nodes-by-type.d.ts +2 -2
- package/queries/index.d.ts +55 -73
- package/queries/is-block-active.d.ts +2 -2
- package/queries/is-include-types.d.ts +2 -2
- package/services/context.service.d.ts +9 -0
- package/services/toolbar.service.d.ts +1 -1
- package/styles/editor.scss +41 -15
- package/styles/index.scss +5 -2
- package/styles/typo.scss +4 -2
- package/transforms/handle-continual-delete-backward.d.ts +3 -0
- package/transforms/handle-continual-insert-break.d.ts +3 -0
- package/transforms/index.d.ts +20 -27
- package/transforms/split-node.d.ts +2 -2
- package/transforms/un-wrap.d.ts +2 -2
- package/utils/is-clean-empty-paragraph.d.ts +8 -0
- package/utils/weak-maps.d.ts +1 -0
- package/esm2015/components/placeholder/placeholder.component.js +0 -88
package/queries/index.d.ts
CHANGED
|
@@ -1,73 +1,55 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
at?: import("slate").BaseRange;
|
|
57
|
-
}) => boolean;
|
|
58
|
-
isDescendant: (node: any) => node is import("slate").Descendant;
|
|
59
|
-
isNodeType: (entry?: import("slate").NodeEntry<import("slate").Node>, { filter, allow, exclude }?: import("@worktile/theia").QueryOptions) => boolean;
|
|
60
|
-
isAcrossBlocks: (editor: import("@worktile/theia").TheEditor, fragment: import("@worktile/theia").CustomElement[]) => boolean;
|
|
61
|
-
isBlockCardCursor: (editor: import("@worktile/theia").TheEditor) => boolean;
|
|
62
|
-
isEmptyContent: (children: import("slate").Descendant[]) => boolean;
|
|
63
|
-
isEmptyParagraphByPath: (editor: import("@worktile/theia").TheEditor, at: import("slate").Path) => boolean;
|
|
64
|
-
isContainer: (editor: import("@worktile/theia").TheEditor, value: import("@worktile/theia").CustomElement) => boolean;
|
|
65
|
-
anchorBlock: (editor: import("@worktile/theia").TheEditor) => import("@worktile/theia").CustomElement;
|
|
66
|
-
anchorBlockEntry: (editor: import("@worktile/theia").TheEditor, at?: import("slate").Path | import("slate").BasePoint) => import("slate").NodeEntry<import("@worktile/theia").CustomElement>;
|
|
67
|
-
anchorInlineEntry: (editor: import("@worktile/theia").TheEditor) => import("slate").NodeEntry<import("@worktile/theia").CustomElement>;
|
|
68
|
-
anchorInline: (editor: import("@worktile/theia").TheEditor) => import("@worktile/theia").CustomElement;
|
|
69
|
-
findPath: (editor: import("slate-angular").AngularEditor, node: import("slate").Node) => import("slate").Path;
|
|
70
|
-
findNode: <T_1 extends import("slate").Node = import("slate").Node>(editor: import("@worktile/theia").TheEditor, options: import("./find-node").FindNodeOptions<T_1>) => import("slate").NodeEntry<T_1>;
|
|
71
|
-
findDescendant: <T_2 extends import("slate").Node = import("slate").Node>(editor: import("@worktile/theia").TheEditor, options: import("./find-node").FindNodeOptions<T_2>) => import("slate").NodeEntry<T_2>;
|
|
72
|
-
someNode: <T_3 extends import("slate").Node = import("slate").Node>(editor: import("@worktile/theia").TheEditor, options: import("./find-node").FindNodeOptions<T_3>) => boolean;
|
|
73
|
-
};
|
|
1
|
+
import { getLastNode } from './get-last-node';
|
|
2
|
+
import { isAncestor } from './is-ancestor';
|
|
3
|
+
import { isCollapsed } from './is-collapsed';
|
|
4
|
+
import { getAnchorBlockEntry } from './get-anchor-block-entry';
|
|
5
|
+
import { isEmptyParagraph } from './is-empty-paragraph';
|
|
6
|
+
import { isParagraph } from './is-paragraph';
|
|
7
|
+
import { isBlockActive } from './is-block-active';
|
|
8
|
+
import { isIncludeTypes } from './is-include-types';
|
|
9
|
+
import { getAboveByType } from './get-above-by-type';
|
|
10
|
+
import { anchorBlockEntry } from './anchor-block-entry';
|
|
11
|
+
import { getNodesByType } from './get-nodes-by-type';
|
|
12
|
+
import { getNodes } from './get-nodes';
|
|
13
|
+
import { anchorBlock } from './anchor-block';
|
|
14
|
+
import { getBlockAbove } from './get-block-above';
|
|
15
|
+
import { isAncestorEmpty } from './is-ancestor-empty';
|
|
16
|
+
import { isBlockAboveEmpty } from './is-block-above-empty';
|
|
17
|
+
import { isNodeTypeIn } from './is-node-type-in';
|
|
18
|
+
import { isFirstChild } from './is-first-child';
|
|
19
|
+
import { getPreviousPath } from './get-previous-path';
|
|
20
|
+
import { getNode } from './get-node';
|
|
21
|
+
import { getParent } from './get-parent';
|
|
22
|
+
import { findPath } from './find-path';
|
|
23
|
+
import { findNode } from './find-node';
|
|
24
|
+
import { findDescendant } from './find-descendant';
|
|
25
|
+
import { getLastChildPath, getLastChild } from './get-last-child-path';
|
|
26
|
+
import { isPointAtRoot } from './is-point-at-root';
|
|
27
|
+
import { isRangeAtRoot } from './is-range-at-root';
|
|
28
|
+
import { getNextSiblingNodes } from './get-next-sibling-nodes';
|
|
29
|
+
import { isBlockTextEmptyAfterSelection } from './is-block-text-empty-after-selection';
|
|
30
|
+
import { getAbove } from './get-above';
|
|
31
|
+
import { isStart } from './is-start';
|
|
32
|
+
import { isRangeAcrossBlocks } from './is-range-across-blocks';
|
|
33
|
+
import { someNode } from './some-node';
|
|
34
|
+
import { getChildren } from './get-children';
|
|
35
|
+
import { isDescendant } from './is-descendant';
|
|
36
|
+
import { isNodeType } from './is-node-type';
|
|
37
|
+
import { anchorInlineEntry } from './anchor-inline-entry';
|
|
38
|
+
import { anchorInline } from './anchor-inline';
|
|
39
|
+
import { getPointBefore } from './get-point-before';
|
|
40
|
+
import { getSelectionNodesByType } from './get-selection-nodes-by-type';
|
|
41
|
+
import { isAcrossBlocks } from './is-across-blocks';
|
|
42
|
+
import { getText } from './get-text';
|
|
43
|
+
import { getPointFromLocation } from './get-point-from-location';
|
|
44
|
+
import { getRangeFromBlockStart } from './get-rang-from-block-start';
|
|
45
|
+
import { getRangeBefore } from './get-range-before';
|
|
46
|
+
import { isBlockCardCursor } from './is-block-card-cursor';
|
|
47
|
+
import { getBlockCardCenterCursor } from './get-block-card-cursor';
|
|
48
|
+
import { isEmptyContent } from './is-empty-content';
|
|
49
|
+
import { getBlockCardAbove } from './get-block-card-above';
|
|
50
|
+
import { getPlainText } from './get-plain-text';
|
|
51
|
+
import { isEmptyParagraphByPath } from './is-empty-paragraph-by-path';
|
|
52
|
+
import { getSelectionMarks } from './get-selection-marks';
|
|
53
|
+
import { isContainer } from './is-container-type';
|
|
54
|
+
import { getContainerBlocks } from './get-container-blocks';
|
|
55
|
+
export { getLastNode, getAnchorBlockEntry, getAboveByType, getNodes, getNodesByType, getBlockAbove, getPreviousPath, getNode, getParent, getLastChild, getLastChildPath, getNextSiblingNodes, getAbove, getChildren, getPointBefore, getSelectionNodesByType, getText, getPointFromLocation, getRangeFromBlockStart, getRangeBefore, getBlockCardCenterCursor, getBlockCardAbove, getPlainText, getSelectionMarks, getContainerBlocks, isAncestor, isCollapsed, isEmptyParagraph, isParagraph, isBlockActive, isIncludeTypes, isAncestorEmpty, isBlockAboveEmpty, isNodeTypeIn, isFirstChild, isPointAtRoot, isRangeAtRoot, isBlockTextEmptyAfterSelection, isStart, isRangeAcrossBlocks, isDescendant, isNodeType, isAcrossBlocks, isBlockCardCursor, isEmptyContent, isEmptyParagraphByPath, isContainer, anchorBlock, anchorBlockEntry, anchorInlineEntry, anchorInline, findPath, findNode, findDescendant, someNode };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
|
-
import {
|
|
3
|
-
export declare const isBlockActive: (editor: Editor, format:
|
|
2
|
+
import { CustomElementKinds } from '../custom-types';
|
|
3
|
+
export declare const isBlockActive: (editor: Editor, format: CustomElementKinds) => boolean;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
|
-
import {
|
|
3
|
-
export declare const isIncludeTypes: (editor: Editor, types:
|
|
2
|
+
import { CustomElementKinds } from '../custom-types';
|
|
3
|
+
export declare const isIncludeTypes: (editor: Editor, types: CustomElementKinds[]) => boolean;
|
|
@@ -16,6 +16,10 @@ interface PaintFormatStatus {
|
|
|
16
16
|
export declare class TheContextService {
|
|
17
17
|
private ngZone;
|
|
18
18
|
private options;
|
|
19
|
+
fileList: {
|
|
20
|
+
url: string;
|
|
21
|
+
file: File;
|
|
22
|
+
}[];
|
|
19
23
|
paintFormatStatus: PaintFormatStatus;
|
|
20
24
|
onMouseUp$: Observable<MouseEvent>;
|
|
21
25
|
onMouseMove$: Observable<MouseEvent>;
|
|
@@ -23,6 +27,11 @@ export declare class TheContextService {
|
|
|
23
27
|
constructor(ngZone: NgZone);
|
|
24
28
|
initialize(options: TheContextOptions): void;
|
|
25
29
|
getOptions(): TheContextOptions;
|
|
30
|
+
setUploadFileList(file: {
|
|
31
|
+
url: string;
|
|
32
|
+
file: File;
|
|
33
|
+
}): void;
|
|
34
|
+
removeUploadImage(file: File): void;
|
|
26
35
|
static ɵfac: i0.ɵɵFactoryDeclaration<TheContextService, never>;
|
|
27
36
|
static ɵprov: i0.ɵɵInjectableDeclaration<TheContextService>;
|
|
28
37
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ToolbarKey, ToolbarItem, ToolbarDefinition, ToolbarEntity, ToolbarInitOption } from '../interfaces';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
3
|
export declare class TheToolbarService {
|
|
4
|
-
initialize(toolbarItems: ToolbarItem[], global?: string[], inline?: string[],
|
|
4
|
+
initialize(toolbarItems: ToolbarItem[], global?: string[], inline?: string[], quick?: string[]): ToolbarInitOption;
|
|
5
5
|
nextToolbarEntity(toolbarDefinition: ToolbarDefinition, toolbarItems: Map<string, ToolbarItem>): ToolbarEntity;
|
|
6
6
|
getToolbarItemByKeys(keys: ToolbarKey[], toolbarItems: Map<string, ToolbarItem>): ToolbarItem[];
|
|
7
7
|
static ɵfac: i0.ɵɵFactoryDeclaration<TheToolbarService, never>;
|
package/styles/editor.scss
CHANGED
|
@@ -12,12 +12,17 @@ $thy-icon-nav-link-margin-right: 5px;
|
|
|
12
12
|
|
|
13
13
|
.the-editable-container {
|
|
14
14
|
padding: 0;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
|
|
16
|
+
&.max-height {
|
|
17
|
+
padding: 0;
|
|
18
|
+
overflow-y: auto;
|
|
19
|
+
overflow-x: hidden;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.the-editor-typo {
|
|
23
|
+
min-height: initial;
|
|
24
|
+
padding: 0;
|
|
25
|
+
}
|
|
21
26
|
}
|
|
22
27
|
|
|
23
28
|
.the-hr {
|
|
@@ -36,11 +41,25 @@ $thy-icon-nav-link-margin-right: 5px;
|
|
|
36
41
|
}
|
|
37
42
|
}
|
|
38
43
|
|
|
44
|
+
.the-editor-disabled {
|
|
45
|
+
.the-check-item {
|
|
46
|
+
input[type='checkbox'] {
|
|
47
|
+
cursor: auto;
|
|
48
|
+
}
|
|
49
|
+
input[type='checkbox']:not(:checked):hover {
|
|
50
|
+
border-color: $gray-300;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
39
55
|
.the-editable-container {
|
|
40
56
|
position: relative;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
57
|
+
|
|
58
|
+
&.max-height {
|
|
59
|
+
padding: 41px 0;
|
|
60
|
+
margin-top: -41px;
|
|
61
|
+
overflow-y: scroll;
|
|
62
|
+
}
|
|
44
63
|
}
|
|
45
64
|
|
|
46
65
|
// list style
|
|
@@ -109,12 +128,19 @@ $thy-icon-nav-link-margin-right: 5px;
|
|
|
109
128
|
}
|
|
110
129
|
}
|
|
111
130
|
|
|
112
|
-
nav-split-line {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
131
|
+
.the-nav-split-line {
|
|
132
|
+
&.horizontal {
|
|
133
|
+
margin: 5px 20px;
|
|
134
|
+
display: block;
|
|
135
|
+
border-top: 1px solid $gray-200;
|
|
136
|
+
}
|
|
137
|
+
&.vertical {
|
|
138
|
+
width: 1px;
|
|
139
|
+
height: 1rem;
|
|
140
|
+
margin-top: 0.45rem;
|
|
141
|
+
margin-right: 5px;
|
|
142
|
+
background: $gray-300;
|
|
143
|
+
}
|
|
118
144
|
}
|
|
119
145
|
|
|
120
146
|
@mixin controlSelected {
|
package/styles/index.scss
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
@import '../components/toolbar-dropdown/toolbar-dropdown.component.scss';
|
|
7
7
|
@import '../components/toolbar-group/toolbar-group.component.scss';
|
|
8
8
|
@import '../components/toolbar/toolbar.component.scss';
|
|
9
|
-
@import '../components/placeholder/placeholder.component.scss';
|
|
10
9
|
@import '../components/color-select/color-select.component.scss';
|
|
11
10
|
@import '../plugins/code/code.component.scss';
|
|
12
11
|
@import '../plugins/link/link.component.scss';
|
|
@@ -14,4 +13,8 @@
|
|
|
14
13
|
@import '../plugins/table/components/table.component.scss';
|
|
15
14
|
@import '../components/table-select/table-select.component.scss';
|
|
16
15
|
@import '../components/conversion-hint/conversion-hint.component.scss';
|
|
17
|
-
@import '../plugins/vertical-align/vertical-align.scss'
|
|
16
|
+
@import '../plugins/vertical-align/vertical-align.scss';
|
|
17
|
+
@import '../components/inline-toolbar/inline-toolbar.component.scss';
|
|
18
|
+
@import '../plugins/quick-insert/components/quick-insert.component.scss';
|
|
19
|
+
@import '../plugins/quick-insert/components/quick-toolbar/quick-toolbar.component.scss';
|
|
20
|
+
@import '../plugins/placeholder/placeholder.component.scss';
|
package/styles/typo.scss
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
@use 'sass:math';
|
|
2
|
+
|
|
1
3
|
$default-text-space: 10px; // text white space 18(distance between paragrahp) - 8(block margin)
|
|
2
4
|
|
|
3
5
|
$headline-one-size: 28px;
|
|
@@ -121,7 +123,7 @@ $selection-background: rgba($color: $primary, $alpha: 0.3);
|
|
|
121
123
|
.slate-element-code,
|
|
122
124
|
.slate-element-image,
|
|
123
125
|
.slate-element-block-quote {
|
|
124
|
-
padding: $default-text-space
|
|
126
|
+
padding: math.div($default-text-space, 2) 0;
|
|
125
127
|
}
|
|
126
128
|
.slate-element-image {
|
|
127
129
|
.image-content {
|
|
@@ -133,7 +135,7 @@ $selection-background: rgba($color: $primary, $alpha: 0.3);
|
|
|
133
135
|
.slate-block-card {
|
|
134
136
|
.card-left,
|
|
135
137
|
.card-right {
|
|
136
|
-
bottom: $default-text-space
|
|
138
|
+
bottom: math.div($default-text-space, 2);
|
|
137
139
|
line-height: 17px; // cursor default height
|
|
138
140
|
}
|
|
139
141
|
&.slate-block-card-table {
|
package/transforms/index.d.ts
CHANGED
|
@@ -1,27 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
unWrap: (editor: import("@worktile/theia").TheEditor, kind: import("@worktile/theia").BlockElementKinds) => void;
|
|
22
|
-
splitNode: (editor: import("@worktile/theia").TheEditor, indivisibleTypes: import("@worktile/theia").ElementKinds[]) => import("slate").Path;
|
|
23
|
-
deleteElement: (editor: import("@worktile/theia").TheEditor, element: import("@worktile/theia").CustomElement) => void;
|
|
24
|
-
setEndSelection: (editor: import("@worktile/theia").TheEditor) => void;
|
|
25
|
-
insertTheElements: (editor: import("@worktile/theia").TheEditor, nodes: import("@worktile/theia").CustomElement[]) => void;
|
|
26
|
-
closeConversionHint: (editor: import("@worktile/theia").TheEditor) => void;
|
|
27
|
-
};
|
|
1
|
+
import { setMarks } from './set-marks';
|
|
2
|
+
import { clearMarks } from './clear-marks';
|
|
3
|
+
import { insertElement } from './insert-element';
|
|
4
|
+
import { insertElementNext } from './insert-element-next';
|
|
5
|
+
import { setNode } from './set-node';
|
|
6
|
+
import { unwrapNodesByType } from './unwrap-nodes-by-type';
|
|
7
|
+
import { onKeyDownResetBlockType } from './on-keydown-reset-block-type';
|
|
8
|
+
import { moveChildren } from './move-children';
|
|
9
|
+
import { insertParagraph } from './insert-paragraph';
|
|
10
|
+
import { applyDeepToNodes } from './apply-deep-to-nodes';
|
|
11
|
+
import { mergeDeepToNodes } from './merge-deep-to-nodes';
|
|
12
|
+
import { unWrap } from './un-wrap';
|
|
13
|
+
import { splitNode } from './split-node';
|
|
14
|
+
import { deleteElement } from './delete-element';
|
|
15
|
+
import { setEndSelection } from './set-end-selection';
|
|
16
|
+
import { insertTheElements } from './insert-elements';
|
|
17
|
+
import { closeConversionHint } from './close-conversion-hint';
|
|
18
|
+
import { handleContinualDeleteBackward } from './handle-continual-delete-backward';
|
|
19
|
+
import { handleContinualInsertBreak } from './handle-continual-insert-break';
|
|
20
|
+
export { setMarks, clearMarks, insertElement, insertElementNext, insertParagraph, setNode, unwrapNodesByType, onKeyDownResetBlockType, moveChildren, applyDeepToNodes, mergeDeepToNodes, unWrap, splitNode, deleteElement, setEndSelection, insertTheElements, closeConversionHint, handleContinualDeleteBackward, handleContinualInsertBreak };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Path, Editor } from 'slate';
|
|
2
|
-
import {
|
|
3
|
-
export declare const splitNode: (editor: Editor, indivisibleTypes:
|
|
2
|
+
import { CustomElementKinds } from '../custom-types';
|
|
3
|
+
export declare const splitNode: (editor: Editor, indivisibleTypes: CustomElementKinds[]) => Path;
|
package/transforms/un-wrap.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
|
-
import {
|
|
3
|
-
export declare const unWrap: (editor: Editor, kind:
|
|
2
|
+
import { CustomElementKinds } from '../custom-types';
|
|
3
|
+
export declare const unWrap: (editor: Editor, kind: CustomElementKinds) => void;
|
package/utils/weak-maps.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ import { ThyPopoverRef } from 'ngx-tethys/popover';
|
|
|
2
2
|
import { Editor } 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
|
+
export declare const THE_EDITOR_QUICK_TOOLBAR_REF: WeakMap<Editor, ThyPopoverRef<any>>;
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import { Component, Input, HostListener } from '@angular/core';
|
|
2
|
-
import { Range, Editor, Node, Text, Element } from 'slate';
|
|
3
|
-
import { AngularEditor } from 'slate-angular';
|
|
4
|
-
import { TheQueries } from '../../queries';
|
|
5
|
-
import { ElementKinds } from '../../constants/node-types';
|
|
6
|
-
import * as i0 from "@angular/core";
|
|
7
|
-
export class ThePlaceholderComponent {
|
|
8
|
-
constructor(renderer, elementRef) {
|
|
9
|
-
this.renderer = renderer;
|
|
10
|
-
this.elementRef = elementRef;
|
|
11
|
-
this.isHide = true;
|
|
12
|
-
}
|
|
13
|
-
get selection() {
|
|
14
|
-
return this.editor.selection;
|
|
15
|
-
}
|
|
16
|
-
handleCompositionStart() {
|
|
17
|
-
this.hide();
|
|
18
|
-
}
|
|
19
|
-
handleCompositionEnd(event) {
|
|
20
|
-
if (!event.data) {
|
|
21
|
-
this.checkStatus();
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
checkStatus(value) {
|
|
25
|
-
const { editor } = this;
|
|
26
|
-
const children = value ? value : editor.children;
|
|
27
|
-
// empty content and no selection processing
|
|
28
|
-
if (this.autoFocus && !this.selection && TheQueries.isEmptyContent(children)) {
|
|
29
|
-
this.updatePosition(30, 51);
|
|
30
|
-
this.isHide = false;
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
if (AngularEditor.isFocused(editor) && this.selection && Range.isCollapsed(this.selection)) {
|
|
34
|
-
const block = Node.ancestor(editor, [this.selection.anchor.path[0]]);
|
|
35
|
-
const textIndent = 'textIndent';
|
|
36
|
-
const align = 'align';
|
|
37
|
-
const hasTextIndent = block[textIndent];
|
|
38
|
-
const hasAlign = block[align];
|
|
39
|
-
if (Node.string(block) === '' &&
|
|
40
|
-
Element.isElement(block) &&
|
|
41
|
-
block.type === ElementKinds.paragraph &&
|
|
42
|
-
block.children.length === 1 &&
|
|
43
|
-
Text.isText(block.children[0]) &&
|
|
44
|
-
!Editor.isVoid(editor, block) &&
|
|
45
|
-
!hasTextIndent &&
|
|
46
|
-
!hasAlign) {
|
|
47
|
-
const rootNode = AngularEditor.toDOMNode(this.editor, block);
|
|
48
|
-
this.updatePosition(rootNode.offsetLeft, rootNode.offsetTop);
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
this.hide();
|
|
53
|
-
}
|
|
54
|
-
updatePosition(left, top) {
|
|
55
|
-
this.isHide = false;
|
|
56
|
-
this.renderer.setStyle(this.elementRef.nativeElement, 'top', `${top}px`);
|
|
57
|
-
this.renderer.setStyle(this.elementRef.nativeElement, 'left', `${left}px`);
|
|
58
|
-
}
|
|
59
|
-
hide() {
|
|
60
|
-
this.isHide = true;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
ThePlaceholderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: ThePlaceholderComponent, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
64
|
-
ThePlaceholderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.7", type: ThePlaceholderComponent, selector: "div[thePlaceholder]", inputs: { editor: "editor", autoFocus: "autoFocus", placeholder: "placeholder" }, host: { listeners: { "document:compositionstart": "handleCompositionStart()", "document:compositionend": "handleCompositionEnd($event)" }, properties: { "class.hide": "isHide" }, classAttribute: "the-placeholder" }, ngImport: i0, template: `{{ placeholder }}`, isInline: true });
|
|
65
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.7", ngImport: i0, type: ThePlaceholderComponent, decorators: [{
|
|
66
|
-
type: Component,
|
|
67
|
-
args: [{
|
|
68
|
-
selector: 'div[thePlaceholder]',
|
|
69
|
-
template: `{{ placeholder }}`,
|
|
70
|
-
host: {
|
|
71
|
-
class: 'the-placeholder',
|
|
72
|
-
'[class.hide]': 'isHide'
|
|
73
|
-
}
|
|
74
|
-
}]
|
|
75
|
-
}], ctorParameters: function () { return [{ type: i0.Renderer2 }, { type: i0.ElementRef }]; }, propDecorators: { editor: [{
|
|
76
|
-
type: Input
|
|
77
|
-
}], autoFocus: [{
|
|
78
|
-
type: Input
|
|
79
|
-
}], placeholder: [{
|
|
80
|
-
type: Input
|
|
81
|
-
}], handleCompositionStart: [{
|
|
82
|
-
type: HostListener,
|
|
83
|
-
args: ['document:compositionstart']
|
|
84
|
-
}], handleCompositionEnd: [{
|
|
85
|
-
type: HostListener,
|
|
86
|
-
args: ['document:compositionend', ['$event']]
|
|
87
|
-
}] } });
|
|
88
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGxhY2Vob2xkZXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvc3JjL2NvbXBvbmVudHMvcGxhY2Vob2xkZXIvcGxhY2Vob2xkZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQWMsS0FBSyxFQUFFLFlBQVksRUFBYSxNQUFNLGVBQ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VudChjaGlsZHJlbikpIHtcbiAgICAgICAgICAgIHRoaXMudXBkYXRlUG9zaXRpb24oMzAsIDUxKTtcbiAgICAgICAgICAgIHRoaXMuaXNIaWRlID0gZmFsc2U7XG4gICAgICAgICAgICByZXR1cm47XG4gICAgICAgIH1cblxuICAgICAgICBpZiAoQW5ndWxhckVkaXRvci5pc0ZvY3VzZWQoZWRpdG9yKSAmJiB0aGlzLnNlbGVjdGlvbiAmJiBSYW5nZS5pc0NvbGxhcHNlZCh0aGlzLnNlbGVjdGlvbikpIHtcbiAgICAgICAgICAgIGNvbnN0IGJsb2NrID0gTm9kZS5hbmNlc3RvcihlZGl0b3IsIFt0aGlzLnNlbGVjdGlvbi5hbmNob3IucGF0aFswXV0pO1xuICAgICAgICAgICAgY29uc3QgdGV4dEluZGVudCA9ICd0ZXh0SW5kZW50JztcbiAgICAgICAgICAgIGNvbnN0IGFsaWduID0gJ2FsaWduJztcbiAgICAgICAgICAgIGNvbnN0IGhhc1RleHRJbmRlbnQgPSBibG9ja1t0ZXh0SW5kZW50XTtcbiAgICAgICAgICAgIGNvbnN0IGhhc0FsaWduID0gYmxvY2tbYWxpZ25dO1xuXG4gICAgICAgICAgICBpZiAoXG4gICAgICAgICAgICAgICAgTm9kZS5zdHJpbmcoYmxvY2spID09PSAnJyAmJlxuICAgICAgICAgICAgICAgIEVsZW1lbnQuaXNFbGVtZW50KGJsb2NrKSAmJlxuICAgICAgICAgICAgICAgIGJsb2NrLnR5cGUgPT09IEVsZW1lbnRLaW5kcy5wYXJhZ3JhcGggJiZcbiAgICAgICAgICAgICAgICBibG9jay5jaGlsZHJlbi5sZW5ndGggPT09IDEgJiZcbiAgICAgICAgICAgICAgICBUZXh0LmlzVGV4dChibG9jay5jaGlsZHJlblswXSkgJiZcbiAgICAgICAgICAgICAgICAhRWRpdG9yLmlzVm9pZChlZGl0b3IsIGJsb2NrKSAmJlxuICAgICAgICAgICAgICAgICFoYXNUZXh0SW5kZW50ICYmXG4gICAgICAgICAgICAgICAgIWhhc0FsaWduXG4gICAgICAgICAgICApIHtcbiAgICAgICAgICAgICAgICBjb25zdCByb290Tm9kZTogSFRNTEVsZW1lbnQgPSBBbmd1bGFyRWRpdG9yLnRvRE9NTm9kZSh0aGlzLmVkaXRvciwgYmxvY2spO1xuICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlUG9zaXRpb24ocm9vdE5vZGUub2Zmc2V0TGVmdCwgcm9vdE5vZGUub2Zmc2V0VG9wKTtcbiAgICAgICAgICAgICAgICByZXR1cm47XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICAgICAgdGhpcy5oaWRlKCk7XG4gICAgfVxuXG4gICAgcHJpdmF0ZSB1cGRhdGVQb3NpdGlvbihsZWZ0OiBudW1iZXIsIHRvcD86IG51bWJlcikge1xuICAgICAgICB0aGlzLmlzSGlkZSA9IGZhbHNlO1xuICAgICAgICB0aGlzLnJlbmRlcmVyLnNldFN0eWxlKHRoaXMuZWxlbWVudFJlZi5uYXRpdmVFbGVtZW50LCAndG9wJywgYCR7dG9wfXB4YCk7XG4gICAgICAgIHRoaXMucmVuZGVyZXIuc2V0U3R5bGUodGhpcy5lbGVtZW50UmVmLm5hdGl2ZUVsZW1lbnQsICdsZWZ0JywgYCR7bGVmdH1weGApO1xuICAgIH1cblxuICAgIHByaXZhdGUgaGlkZSgpIHtcbiAgICAgICAgdGhpcy5pc0hpZGUgPSB0cnVlO1xuICAgIH1cbn1cbiJdfQ==
|