@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.
Files changed (42) hide show
  1. package/bundles/worktile-theia.umd.js +46 -24
  2. package/bundles/worktile-theia.umd.js.map +1 -1
  3. package/constants/node-types.d.ts +2 -1
  4. package/esm2015/components/toolbar-dropdown/toolbar-dropdown.component.js +3 -2
  5. package/esm2015/components/toolbar-group/toolbar-group.component.js +2 -1
  6. package/esm2015/constants/node-types.js +3 -2
  7. package/esm2015/core/toolbar-item/base-toolbar-item.js +4 -4
  8. package/esm2015/interfaces/toolbar.js +1 -1
  9. package/esm2015/plugins/align/align.plugin.js +3 -3
  10. package/esm2015/plugins/code/code.component.js +8 -5
  11. package/esm2015/plugins/color/color.plugin.js +3 -3
  12. package/esm2015/plugins/color/toolbar-item.component.js +2 -1
  13. package/esm2015/plugins/common/reset-type.plugin.js +3 -3
  14. package/esm2015/plugins/deserializers/deserialize-md.plugin.js +2 -1
  15. package/esm2015/plugins/font-size/font-size.editor.js +3 -3
  16. package/esm2015/plugins/heading/heading.editor.js +3 -3
  17. package/esm2015/plugins/image/image.component.js +2 -1
  18. package/esm2015/plugins/indent/indent.plugin.js +3 -3
  19. package/esm2015/plugins/inline-code/inline-code.plugin.js +3 -3
  20. package/esm2015/plugins/link/link.component.js +3 -1
  21. package/esm2015/plugins/link/link.plugin.js +3 -3
  22. package/esm2015/plugins/mark/mark.plugin.js +3 -3
  23. package/esm2015/plugins/quick-insert/quick-insert.editor.js +2 -1
  24. package/esm2015/plugins/table/components/toolbar/table-toolbar.component.js +2 -1
  25. package/esm2015/plugins/table/table.service.js +2 -1
  26. package/esm2015/plugins/table/toolbar-item.component.js +2 -1
  27. package/esm2015/plugins/vertical-align/toolbar-item.component.js +2 -1
  28. package/esm2015/queries/get-plugin-by-toolbar.js +13 -0
  29. package/esm2015/queries/get-toolbar-disabled.js +1 -1
  30. package/esm2015/queries/index.js +3 -3
  31. package/esm2015/services/color-select.service.js +2 -1
  32. package/esm2015/services/table-contextmenu.service.js +2 -1
  33. package/fesm2015/worktile-theia.js +45 -24
  34. package/fesm2015/worktile-theia.js.map +1 -1
  35. package/interfaces/toolbar.d.ts +2 -0
  36. package/package.json +1 -1
  37. package/plugins/code/code.component.d.ts +1 -1
  38. package/queries/get-plugin-by-toolbar.d.ts +3 -0
  39. package/queries/get-toolbar-disabled.d.ts +2 -2
  40. package/queries/index.d.ts +2 -2
  41. package/esm2015/queries/get-plugin-key-by-toolbar-key.js +0 -10
  42. package/queries/get-plugin-key-by-toolbar-key.d.ts +0 -3
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@worktile/theia",
3
- "version": "3.0.4",
3
+ "version": "3.0.7",
4
4
  "description": "theia editor",
5
5
  "author": "YanDong <nanianqiumo@foxmail.com>",
6
6
  "homepage": "https://github.com/atinc/theia#readme",
@@ -36,7 +36,7 @@ export declare class TheCodeComponent extends TheBaseElementComponent<CodeElemen
36
36
  lineWrapping: boolean;
37
37
  cursorBlinkRate: number;
38
38
  };
39
- actives: DefaultToolbarItem;
39
+ activeLanguage: DefaultToolbarItem;
40
40
  resizeBounds: any;
41
41
  get code(): string;
42
42
  codemirror: CodeMirrorComponent;
@@ -0,0 +1,3 @@
1
+ import { Editor } from 'slate';
2
+ import { ThePlugin, ToolbarItem } from '../interfaces';
3
+ export declare const getPluginByToolbarItem: (editor: Editor, toolbarItem: ToolbarItem) => ThePlugin;
@@ -1,4 +1,4 @@
1
1
  import { Editor } from 'slate';
2
- import { PluginKeys } from '../interfaces';
2
+ import { PluginKey } from '../interfaces';
3
3
  import { CustomElementKinds } from '../custom-types';
4
- export declare const getToolbarItemDisabled: (editor: Editor, key: PluginKeys, customTypes?: CustomElementKinds[]) => boolean;
4
+ export declare const getToolbarItemDisabled: (editor: Editor, key: PluginKey, customTypes?: CustomElementKinds[]) => boolean;
@@ -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 { getPluginKeyByToolbarKey } from './get-plugin-key-by-toolbar-key';
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, getPluginKeyByToolbarKey };
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LXBsdWdpbi1rZXktYnktdG9vbGJhci1rZXkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi9wYWNrYWdlcy9zcmMvcXVlcmllcy9nZXQtcGx1Z2luLWtleS1ieS10b29sYmFyLWtleS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHQSxNQUFNLENBQUMsTUFBTSx3QkFBd0IsR0FBRyxDQUFDLE1BQWMsRUFBRSxVQUFzQixFQUFjLEVBQUU7SUFDM0YsS0FBSyxJQUFJLEdBQUcsSUFBSSxNQUFNLENBQUMsWUFBWSxFQUFFO1FBQ2pDLE1BQU0sWUFBWSxHQUFHLE1BQU0sQ0FBQyxZQUFZLENBQUMsR0FBRyxDQUFDLENBQUMsWUFBWSxDQUFDO1FBQzNELElBQUksWUFBWSxJQUFJLFlBQVksQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsR0FBRyxLQUFLLFVBQVUsQ0FBQyxFQUFFO1lBQ3BFLFVBQVUsR0FBRyxHQUFpQixDQUFDO1NBQ2xDO0tBQ0o7SUFDRCxPQUFPLFVBQXdCLENBQUM7QUFDcEMsQ0FBQyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgRWRpdG9yIH0gZnJvbSAnc2xhdGUnO1xuaW1wb3J0IHsgUGx1Z2luS2V5cywgVG9vbGJhcktleSB9IGZyb20gJy4uL2ludGVyZmFjZXMnO1xuXG5leHBvcnQgY29uc3QgZ2V0UGx1Z2luS2V5QnlUb29sYmFyS2V5ID0gKGVkaXRvcjogRWRpdG9yLCB0b29sYmFyS2V5OiBUb29sYmFyS2V5KTogUGx1Z2luS2V5cyA9PiB7XG4gICAgZm9yIChsZXQga2V5IGluIGVkaXRvci5wbHVnaW5zQnlLZXkpIHtcbiAgICAgICAgY29uc3QgdG9vbGJhckl0ZW1zID0gZWRpdG9yLnBsdWdpbnNCeUtleVtrZXldLnRvb2xiYXJJdGVtcztcbiAgICAgICAgaWYgKHRvb2xiYXJJdGVtcyAmJiB0b29sYmFySXRlbXMuc29tZShpdGVtID0+IGl0ZW0ua2V5ID09PSB0b29sYmFyS2V5KSkge1xuICAgICAgICAgICAgdG9vbGJhcktleSA9IGtleSBhcyBQbHVnaW5LZXlzO1xuICAgICAgICB9XG4gICAgfVxuICAgIHJldHVybiB0b29sYmFyS2V5IGFzIFBsdWdpbktleXM7XG59O1xuIl19
@@ -1,3 +0,0 @@
1
- import { Editor } from 'slate';
2
- import { PluginKeys, ToolbarKey } from '../interfaces';
3
- export declare const getPluginKeyByToolbarKey: (editor: Editor, toolbarKey: ToolbarKey) => PluginKeys;