@worktile/theia 3.0.4 → 3.0.7
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 +46 -24
- package/bundles/worktile-theia.umd.js.map +1 -1
- package/constants/node-types.d.ts +2 -1
- package/esm2015/components/toolbar-dropdown/toolbar-dropdown.component.js +3 -2
- package/esm2015/components/toolbar-group/toolbar-group.component.js +2 -1
- package/esm2015/constants/node-types.js +3 -2
- package/esm2015/core/toolbar-item/base-toolbar-item.js +4 -4
- package/esm2015/interfaces/toolbar.js +1 -1
- package/esm2015/plugins/align/align.plugin.js +3 -3
- package/esm2015/plugins/code/code.component.js +8 -5
- package/esm2015/plugins/color/color.plugin.js +3 -3
- package/esm2015/plugins/color/toolbar-item.component.js +2 -1
- package/esm2015/plugins/common/reset-type.plugin.js +3 -3
- package/esm2015/plugins/deserializers/deserialize-md.plugin.js +2 -1
- package/esm2015/plugins/font-size/font-size.editor.js +3 -3
- package/esm2015/plugins/heading/heading.editor.js +3 -3
- package/esm2015/plugins/image/image.component.js +2 -1
- package/esm2015/plugins/indent/indent.plugin.js +3 -3
- package/esm2015/plugins/inline-code/inline-code.plugin.js +3 -3
- package/esm2015/plugins/link/link.component.js +3 -1
- package/esm2015/plugins/link/link.plugin.js +3 -3
- package/esm2015/plugins/mark/mark.plugin.js +3 -3
- package/esm2015/plugins/quick-insert/quick-insert.editor.js +2 -1
- package/esm2015/plugins/table/components/toolbar/table-toolbar.component.js +2 -1
- package/esm2015/plugins/table/table.service.js +2 -1
- package/esm2015/plugins/table/toolbar-item.component.js +2 -1
- package/esm2015/plugins/vertical-align/toolbar-item.component.js +2 -1
- package/esm2015/queries/get-plugin-by-toolbar.js +13 -0
- package/esm2015/queries/get-toolbar-disabled.js +1 -1
- package/esm2015/queries/index.js +3 -3
- package/esm2015/services/color-select.service.js +2 -1
- package/esm2015/services/table-contextmenu.service.js +2 -1
- package/fesm2015/worktile-theia.js +45 -24
- package/fesm2015/worktile-theia.js.map +1 -1
- package/interfaces/toolbar.d.ts +2 -0
- package/package.json +1 -1
- package/plugins/code/code.component.d.ts +1 -1
- package/queries/get-plugin-by-toolbar.d.ts +3 -0
- package/queries/get-toolbar-disabled.d.ts +2 -2
- package/queries/index.d.ts +2 -2
- package/esm2015/queries/get-plugin-key-by-toolbar-key.js +0 -10
- package/queries/get-plugin-key-by-toolbar-key.d.ts +0 -3
package/interfaces/toolbar.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ComponentType } from '@angular/cdk/portal';
|
|
2
2
|
import { Editor } from 'slate';
|
|
3
3
|
import { ElementKinds, MarkTypes, DropdownMode } from '../constants';
|
|
4
|
+
import { PluginKey } from './plugins';
|
|
4
5
|
export declare type ToolbarKey = MarkTypes | ElementKinds | string;
|
|
5
6
|
export declare enum ToolbarItemType {
|
|
6
7
|
default = "default",
|
|
@@ -18,6 +19,7 @@ export declare type ToolbarDefinition = {
|
|
|
18
19
|
};
|
|
19
20
|
interface ToolbarItemBase {
|
|
20
21
|
key: ToolbarKey;
|
|
22
|
+
pluginKey?: PluginKey;
|
|
21
23
|
execute?: (editor: Editor) => void;
|
|
22
24
|
active?: (editor: Editor) => boolean | string;
|
|
23
25
|
disable?: (editor: Editor) => boolean;
|
package/package.json
CHANGED
|
@@ -36,7 +36,7 @@ export declare class TheCodeComponent extends TheBaseElementComponent<CodeElemen
|
|
|
36
36
|
lineWrapping: boolean;
|
|
37
37
|
cursorBlinkRate: number;
|
|
38
38
|
};
|
|
39
|
-
|
|
39
|
+
activeLanguage: DefaultToolbarItem;
|
|
40
40
|
resizeBounds: any;
|
|
41
41
|
get code(): string;
|
|
42
42
|
codemirror: CodeMirrorComponent;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Editor } from 'slate';
|
|
2
|
-
import {
|
|
2
|
+
import { PluginKey } from '../interfaces';
|
|
3
3
|
import { CustomElementKinds } from '../custom-types';
|
|
4
|
-
export declare const getToolbarItemDisabled: (editor: Editor, key:
|
|
4
|
+
export declare const getToolbarItemDisabled: (editor: Editor, key: PluginKey, customTypes?: CustomElementKinds[]) => boolean;
|
package/queries/index.d.ts
CHANGED
|
@@ -53,5 +53,5 @@ import { getDirectlyParent } from './get-directly-parent';
|
|
|
53
53
|
import { getInsertElementsPath } from './get-insert-elements-path';
|
|
54
54
|
import { isContainNestedType } from './is-contain-nested-type';
|
|
55
55
|
import { getToolbarItemDisabled } from './get-toolbar-disabled';
|
|
56
|
-
import {
|
|
57
|
-
export { getLastNode, getAnchorBlockEntry, getAboveByType, getNodes, getNodesByType, getBlockAbove, getPreviousPath, getNode, getParent, getLastChild, getLastChildPath, getNextSiblingNodes, getAbove, getPointBefore, getSelectionNodesByType, getText, getPointFromLocation, getRangeFromBlockStart, getRangeBefore, getBlockCardCenterCursor, getBlockCardAbove, getPlainText, getSelectionMarks, getContainerBlocks, getDirectlyParent, isAncestor, isCollapsed, isEmptyParagraph, isParagraph, isBlockActive, isIncludeTypes, isAncestorEmpty, isBlockAboveEmpty, isNodeTypeIn, isFirstChild, isPointAtRoot, isRangeAtRoot, isBlockTextEmptyAfterSelection, isStart, isRangeAcrossBlocks, isDescendant, isNodeType, isAcrossBlocks, isBlockCardCursor, isEmptyParagraphByPath, isContainer, getInsertElementsPath, isContainNestedType, anchorBlock, anchorBlockEntry, anchorInlineEntry, findPath, findNode, findDescendant, someNode, getToolbarItemDisabled,
|
|
56
|
+
import { getPluginByToolbarItem } from './get-plugin-by-toolbar';
|
|
57
|
+
export { getLastNode, getAnchorBlockEntry, getAboveByType, getNodes, getNodesByType, getBlockAbove, getPreviousPath, getNode, getParent, getLastChild, getLastChildPath, getNextSiblingNodes, getAbove, getPointBefore, getSelectionNodesByType, getText, getPointFromLocation, getRangeFromBlockStart, getRangeBefore, getBlockCardCenterCursor, getBlockCardAbove, getPlainText, getSelectionMarks, getContainerBlocks, getDirectlyParent, isAncestor, isCollapsed, isEmptyParagraph, isParagraph, isBlockActive, isIncludeTypes, isAncestorEmpty, isBlockAboveEmpty, isNodeTypeIn, isFirstChild, isPointAtRoot, isRangeAtRoot, isBlockTextEmptyAfterSelection, isStart, isRangeAcrossBlocks, isDescendant, isNodeType, isAcrossBlocks, isBlockCardCursor, isEmptyParagraphByPath, isContainer, getInsertElementsPath, isContainNestedType, anchorBlock, anchorBlockEntry, anchorInlineEntry, findPath, findNode, findDescendant, someNode, getToolbarItemDisabled, getPluginByToolbarItem };
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export const getPluginKeyByToolbarKey = (editor, toolbarKey) => {
|
|
2
|
-
for (let key in editor.pluginsByKey) {
|
|
3
|
-
const toolbarItems = editor.pluginsByKey[key].toolbarItems;
|
|
4
|
-
if (toolbarItems && toolbarItems.some(item => item.key === toolbarKey)) {
|
|
5
|
-
toolbarKey = key;
|
|
6
|
-
}
|
|
7
|
-
}
|
|
8
|
-
return toolbarKey;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LXBsdWdpbi1rZXktYnktdG9vbGJhci1rZXkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9zcmMvcXVlcmllcy9nZXQtcGx1Z2luLWtleS1ieS10b29sYmFyLWtleS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHQSxNQUFNLENBQUMsTUFBTSx3QkFBd0IsR0FBRyxDQUFDLE1BQWMsRUFBRSxVQUFzQixFQUFjLEVBQUU7SUFDM0YsS0FBSyxJQUFJLEdBQUcsSUFBSSxNQUFNLENBQUMsWUFBWSxFQUFFO1FBQ2pDLE1BQU0sWUFBWSxHQUFHLE1BQU0sQ0FBQyxZQUFZLENBQUMsR0FBRyxDQUFDLENBQUMsWUFBWSxDQUFDO1FBQzNELElBQUksWUFBWSxJQUFJLFlBQVksQ0FBQyxJQUFJLENBQUMsSUF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