@wangeditor-next/core 1.7.5 → 1.7.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/dist/core/src/config/index.d.ts +13 -13
- package/dist/core/src/config/interface.d.ts +58 -58
- package/dist/core/src/config/register.d.ts +12 -12
- package/dist/core/src/constants/index.d.ts +1 -1
- package/dist/core/src/constants/svg.d.ts +12 -12
- package/dist/core/src/create/bind-node-relation.d.ts +15 -15
- package/dist/core/src/create/create-editor.d.ts +21 -21
- package/dist/core/src/create/create-toolbar.d.ts +14 -14
- package/dist/core/src/create/helper.d.ts +30 -30
- package/dist/core/src/create/index.d.ts +7 -7
- package/dist/core/src/editor/dom-editor.d.ts +143 -143
- package/dist/core/src/editor/interface.d.ts +67 -67
- package/dist/core/src/editor/plugins/with-config.d.ts +7 -6
- package/dist/core/src/editor/plugins/with-content.d.ts +7 -6
- package/dist/core/src/editor/plugins/with-dom.d.ts +10 -9
- package/dist/core/src/editor/plugins/with-emitter.d.ts +7 -6
- package/dist/core/src/editor/plugins/with-event-data.d.ts +7 -6
- package/dist/core/src/editor/plugins/with-max-length.d.ts +7 -6
- package/dist/core/src/editor/plugins/with-selection.d.ts +7 -6
- package/dist/core/src/i18n/index.d.ts +32 -32
- package/dist/core/src/index.d.ts +32 -32
- package/dist/core/src/menus/bar/HoverBar.d.ts +48 -48
- package/dist/core/src/menus/bar/Toolbar.d.ts +35 -35
- package/dist/core/src/menus/bar-item/BaseButton.d.ts +26 -26
- package/dist/core/src/menus/bar-item/DropPanelButton.d.ts +14 -14
- package/dist/core/src/menus/bar-item/GroupButton.d.ts +17 -17
- package/dist/core/src/menus/bar-item/ModalButton.d.ts +25 -25
- package/dist/core/src/menus/bar-item/Select.d.ts +22 -22
- package/dist/core/src/menus/bar-item/SimpleButton.d.ts +11 -11
- package/dist/core/src/menus/bar-item/index.d.ts +24 -24
- package/dist/core/src/menus/bar-item/tooltip.d.ts +6 -6
- package/dist/core/src/menus/helpers/helpers.d.ts +18 -18
- package/dist/core/src/menus/helpers/position.d.ts +36 -36
- package/dist/core/src/menus/index.d.ts +9 -9
- package/dist/core/src/menus/interface.d.ts +66 -66
- package/dist/core/src/menus/panel-and-modal/BaseClass.d.ts +26 -26
- package/dist/core/src/menus/panel-and-modal/DropPanel.d.ts +14 -14
- package/dist/core/src/menus/panel-and-modal/Modal.d.ts +44 -44
- package/dist/core/src/menus/panel-and-modal/SelectList.d.ts +20 -20
- package/dist/core/src/menus/register.d.ts +16 -16
- package/dist/core/src/parse-html/helper.d.ts +10 -10
- package/dist/core/src/parse-html/index.d.ts +35 -35
- package/dist/core/src/parse-html/parse-common-elem-html.d.ts +15 -15
- package/dist/core/src/parse-html/parse-elem-html.d.ts +15 -15
- package/dist/core/src/parse-html/parse-text-elem-html.d.ts +15 -15
- package/dist/core/src/render/element/getRenderElem.d.ts +11 -11
- package/dist/core/src/render/element/renderElement.d.ts +9 -9
- package/dist/core/src/render/element/renderStyle.d.ts +13 -13
- package/dist/core/src/render/helper.d.ts +6 -6
- package/dist/core/src/render/index.d.ts +27 -27
- package/dist/core/src/render/node2Vnode.d.ts +15 -15
- package/dist/core/src/render/text/genVnode.d.ts +9 -9
- package/dist/core/src/render/text/renderStyle.d.ts +13 -13
- package/dist/core/src/render/text/renderText.d.ts +9 -9
- package/dist/core/src/text-area/TextArea.d.ts +47 -47
- package/dist/core/src/text-area/event-handlers/beforeInput.d.ts +8 -8
- package/dist/core/src/text-area/event-handlers/blur.d.ts +8 -8
- package/dist/core/src/text-area/event-handlers/click.d.ts +8 -8
- package/dist/core/src/text-area/event-handlers/composition.d.ts +27 -27
- package/dist/core/src/text-area/event-handlers/copy.d.ts +8 -8
- package/dist/core/src/text-area/event-handlers/cut.d.ts +8 -8
- package/dist/core/src/text-area/event-handlers/drag.d.ts +9 -9
- package/dist/core/src/text-area/event-handlers/drop.d.ts +8 -8
- package/dist/core/src/text-area/event-handlers/focus.d.ts +8 -8
- package/dist/core/src/text-area/event-handlers/index.d.ts +35 -35
- package/dist/core/src/text-area/event-handlers/keydown.d.ts +8 -8
- package/dist/core/src/text-area/event-handlers/keypress.d.ts +8 -8
- package/dist/core/src/text-area/event-handlers/paste.d.ts +8 -8
- package/dist/core/src/text-area/helpers.d.ts +26 -26
- package/dist/core/src/text-area/place-holder.d.ts +18 -18
- package/dist/core/src/text-area/syncSelection.d.ts +19 -19
- package/dist/core/src/text-area/update-view.d.ts +13 -13
- package/dist/core/src/to-html/elem2html.d.ts +8 -8
- package/dist/core/src/to-html/index.d.ts +32 -32
- package/dist/core/src/to-html/node2html.d.ts +8 -8
- package/dist/core/src/to-html/text2html.d.ts +8 -8
- package/dist/core/src/upload/createUploader.d.ts +8 -8
- package/dist/core/src/upload/index.d.ts +7 -7
- package/dist/core/src/upload/interface.d.ts +28 -28
- package/dist/core/src/utils/dom.d.ts +102 -102
- package/dist/core/src/utils/hotkeys.d.ts +35 -35
- package/dist/core/src/utils/key.d.ts +11 -11
- package/dist/core/src/utils/line.d.ts +14 -14
- package/dist/core/src/utils/ua.d.ts +14 -14
- package/dist/core/src/utils/util.d.ts +28 -28
- package/dist/core/src/utils/vdom.d.ts +34 -34
- package/dist/core/src/utils/weak-maps.d.ts +56 -56
- package/dist/index.js +7 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +9 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +12 -9
- package/dist/index.esm.js +0 -9
- package/dist/index.esm.js.map +0 -1
package/dist/core/src/index.d.ts
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description core index
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import './assets/index.less';
|
|
6
|
-
import { RenderStyleFnType, IRenderElemConf } from './render/index';
|
|
7
|
-
import { styleToHtmlFnType, IElemToHtmlConf } from './to-html/index';
|
|
8
|
-
import { IPreParseHtmlConf, ParseStyleHtmlFnType, IParseElemHtmlConf } from './parse-html/index';
|
|
9
|
-
import { IRegisterMenuConf } from './menus/index';
|
|
10
|
-
import { IDomEditor } from './editor/interface';
|
|
11
|
-
export * from './create/index';
|
|
12
|
-
export { IEditorConfig, IToolbarConfig } from './config/interface';
|
|
13
|
-
export * from './editor/interface';
|
|
14
|
-
export * from './editor/dom-editor';
|
|
15
|
-
export * from './render/index';
|
|
16
|
-
export * from './to-html/index';
|
|
17
|
-
export * from './parse-html/index';
|
|
18
|
-
export * from './menus/index';
|
|
19
|
-
export * from './upload/index';
|
|
20
|
-
export * from './i18n/index';
|
|
21
|
-
export * from './utils/dom';
|
|
22
|
-
export interface IModuleConf {
|
|
23
|
-
menus: Array<IRegisterMenuConf>;
|
|
24
|
-
renderStyle: RenderStyleFnType;
|
|
25
|
-
renderElems: Array<IRenderElemConf>;
|
|
26
|
-
styleToHtml: styleToHtmlFnType;
|
|
27
|
-
elemsToHtml: Array<IElemToHtmlConf>;
|
|
28
|
-
preParseHtml: Array<IPreParseHtmlConf>;
|
|
29
|
-
parseStyleHtml: ParseStyleHtmlFnType;
|
|
30
|
-
parseElemsHtml: Array<IParseElemHtmlConf>;
|
|
31
|
-
editorPlugin: <T extends IDomEditor>(editor: T) => T;
|
|
32
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @description core index
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import './assets/index.less';
|
|
6
|
+
import { RenderStyleFnType, IRenderElemConf } from './render/index';
|
|
7
|
+
import { styleToHtmlFnType, IElemToHtmlConf } from './to-html/index';
|
|
8
|
+
import { IPreParseHtmlConf, ParseStyleHtmlFnType, IParseElemHtmlConf } from './parse-html/index';
|
|
9
|
+
import { IRegisterMenuConf } from './menus/index';
|
|
10
|
+
import { IDomEditor } from './editor/interface';
|
|
11
|
+
export * from './create/index';
|
|
12
|
+
export { IEditorConfig, IToolbarConfig } from './config/interface';
|
|
13
|
+
export * from './editor/interface';
|
|
14
|
+
export * from './editor/dom-editor';
|
|
15
|
+
export * from './render/index';
|
|
16
|
+
export * from './to-html/index';
|
|
17
|
+
export * from './parse-html/index';
|
|
18
|
+
export * from './menus/index';
|
|
19
|
+
export * from './upload/index';
|
|
20
|
+
export * from './i18n/index';
|
|
21
|
+
export * from './utils/dom';
|
|
22
|
+
export interface IModuleConf {
|
|
23
|
+
menus: Array<IRegisterMenuConf>;
|
|
24
|
+
renderStyle: RenderStyleFnType;
|
|
25
|
+
renderElems: Array<IRenderElemConf>;
|
|
26
|
+
styleToHtml: styleToHtmlFnType;
|
|
27
|
+
elemsToHtml: Array<IElemToHtmlConf>;
|
|
28
|
+
preParseHtml: Array<IPreParseHtmlConf>;
|
|
29
|
+
parseStyleHtml: ParseStyleHtmlFnType;
|
|
30
|
+
parseElemsHtml: Array<IParseElemHtmlConf>;
|
|
31
|
+
editorPlugin: <T extends IDomEditor>(editor: T) => T;
|
|
32
|
+
}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description hover bar class
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IButtonMenu, ISelectMenu, IDropPanelMenu, IModalMenu } from '../interface';
|
|
6
|
-
type MenuType = IButtonMenu | ISelectMenu | IDropPanelMenu | IModalMenu;
|
|
7
|
-
declare class HoverBar {
|
|
8
|
-
private readonly $elem;
|
|
9
|
-
private menus;
|
|
10
|
-
private hoverbarItems;
|
|
11
|
-
private prevSelectedNode;
|
|
12
|
-
private isShow;
|
|
13
|
-
private lngListen;
|
|
14
|
-
constructor();
|
|
15
|
-
getMenus(): {
|
|
16
|
-
[key: string]: MenuType;
|
|
17
|
-
};
|
|
18
|
-
hideAndClean(): void;
|
|
19
|
-
/**
|
|
20
|
-
* 判断 hoverbar 是否在网页下部?
|
|
21
|
-
* 如果是,SelectList 和 DropPanel 要显示在 hoverbar 上面
|
|
22
|
-
*/
|
|
23
|
-
private checkPositionBottom;
|
|
24
|
-
private show;
|
|
25
|
-
private changeItemsState;
|
|
26
|
-
private registerItems;
|
|
27
|
-
private registerSingleItem;
|
|
28
|
-
private setPosition;
|
|
29
|
-
/**
|
|
30
|
-
* 获取选中的 node ,以及对应的 menu keys
|
|
31
|
-
*/
|
|
32
|
-
private getSelectedNodeAndMenuKeys;
|
|
33
|
-
/**
|
|
34
|
-
* editor onChange 时触发(涉及 DOM 操作,加防抖)
|
|
35
|
-
*/
|
|
36
|
-
changeHoverbarState: any;
|
|
37
|
-
private getEditorInstance;
|
|
38
|
-
private getHoverbarKeysConf;
|
|
39
|
-
/**
|
|
40
|
-
* 检查两个 node 是否 path 相等
|
|
41
|
-
*/
|
|
42
|
-
private isSamePath;
|
|
43
|
-
/**
|
|
44
|
-
* 销毁 hoverbar
|
|
45
|
-
*/
|
|
46
|
-
destroy(): void;
|
|
47
|
-
}
|
|
48
|
-
export default HoverBar;
|
|
1
|
+
/**
|
|
2
|
+
* @description hover bar class
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IButtonMenu, ISelectMenu, IDropPanelMenu, IModalMenu } from '../interface';
|
|
6
|
+
type MenuType = IButtonMenu | ISelectMenu | IDropPanelMenu | IModalMenu;
|
|
7
|
+
declare class HoverBar {
|
|
8
|
+
private readonly $elem;
|
|
9
|
+
private menus;
|
|
10
|
+
private hoverbarItems;
|
|
11
|
+
private prevSelectedNode;
|
|
12
|
+
private isShow;
|
|
13
|
+
private lngListen;
|
|
14
|
+
constructor();
|
|
15
|
+
getMenus(): {
|
|
16
|
+
[key: string]: MenuType;
|
|
17
|
+
};
|
|
18
|
+
hideAndClean(): void;
|
|
19
|
+
/**
|
|
20
|
+
* 判断 hoverbar 是否在网页下部?
|
|
21
|
+
* 如果是,SelectList 和 DropPanel 要显示在 hoverbar 上面
|
|
22
|
+
*/
|
|
23
|
+
private checkPositionBottom;
|
|
24
|
+
private show;
|
|
25
|
+
private changeItemsState;
|
|
26
|
+
private registerItems;
|
|
27
|
+
private registerSingleItem;
|
|
28
|
+
private setPosition;
|
|
29
|
+
/**
|
|
30
|
+
* 获取选中的 node ,以及对应的 menu keys
|
|
31
|
+
*/
|
|
32
|
+
private getSelectedNodeAndMenuKeys;
|
|
33
|
+
/**
|
|
34
|
+
* editor onChange 时触发(涉及 DOM 操作,加防抖)
|
|
35
|
+
*/
|
|
36
|
+
changeHoverbarState: any;
|
|
37
|
+
private getEditorInstance;
|
|
38
|
+
private getHoverbarKeysConf;
|
|
39
|
+
/**
|
|
40
|
+
* 检查两个 node 是否 path 相等
|
|
41
|
+
*/
|
|
42
|
+
private isSamePath;
|
|
43
|
+
/**
|
|
44
|
+
* 销毁 hoverbar
|
|
45
|
+
*/
|
|
46
|
+
destroy(): void;
|
|
47
|
+
}
|
|
48
|
+
export default HoverBar;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description classic toolbar
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Dom7Array, DOMElement } from '../../utils/dom';
|
|
6
|
-
import { IButtonMenu, ISelectMenu, IDropPanelMenu, IModalMenu } from '../interface';
|
|
7
|
-
import { IToolbarConfig } from '../../config/interface';
|
|
8
|
-
type MenuType = IButtonMenu | ISelectMenu | IDropPanelMenu | IModalMenu;
|
|
9
|
-
declare class Toolbar {
|
|
10
|
-
$box: Dom7Array;
|
|
11
|
-
private readonly $toolbar;
|
|
12
|
-
private menus;
|
|
13
|
-
private toolbarItems;
|
|
14
|
-
private config;
|
|
15
|
-
private lngListen;
|
|
16
|
-
constructor(boxSelector: string | DOMElement, config: Partial<IToolbarConfig>);
|
|
17
|
-
getMenus(): {
|
|
18
|
-
[key: string]: MenuType;
|
|
19
|
-
};
|
|
20
|
-
getConfig(): Partial<IToolbarConfig>;
|
|
21
|
-
private initToolbar;
|
|
22
|
-
private registerItems;
|
|
23
|
-
private registerGroup;
|
|
24
|
-
private registerSingleItem;
|
|
25
|
-
private getEditorInstance;
|
|
26
|
-
/**
|
|
27
|
-
* editor onChange 时触发(涉及 DOM 操作,加防抖)
|
|
28
|
-
*/
|
|
29
|
-
changeToolbarState: any;
|
|
30
|
-
/**
|
|
31
|
-
* 销毁 toolbar
|
|
32
|
-
*/
|
|
33
|
-
destroy(): void;
|
|
34
|
-
}
|
|
35
|
-
export default Toolbar;
|
|
1
|
+
/**
|
|
2
|
+
* @description classic toolbar
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Dom7Array, DOMElement } from '../../utils/dom';
|
|
6
|
+
import { IButtonMenu, ISelectMenu, IDropPanelMenu, IModalMenu } from '../interface';
|
|
7
|
+
import { IToolbarConfig } from '../../config/interface';
|
|
8
|
+
type MenuType = IButtonMenu | ISelectMenu | IDropPanelMenu | IModalMenu;
|
|
9
|
+
declare class Toolbar {
|
|
10
|
+
$box: Dom7Array;
|
|
11
|
+
private readonly $toolbar;
|
|
12
|
+
private menus;
|
|
13
|
+
private toolbarItems;
|
|
14
|
+
private config;
|
|
15
|
+
private lngListen;
|
|
16
|
+
constructor(boxSelector: string | DOMElement, config: Partial<IToolbarConfig>);
|
|
17
|
+
getMenus(): {
|
|
18
|
+
[key: string]: MenuType;
|
|
19
|
+
};
|
|
20
|
+
getConfig(): Partial<IToolbarConfig>;
|
|
21
|
+
private initToolbar;
|
|
22
|
+
private registerItems;
|
|
23
|
+
private registerGroup;
|
|
24
|
+
private registerSingleItem;
|
|
25
|
+
private getEditorInstance;
|
|
26
|
+
/**
|
|
27
|
+
* editor onChange 时触发(涉及 DOM 操作,加防抖)
|
|
28
|
+
*/
|
|
29
|
+
changeToolbarState: any;
|
|
30
|
+
/**
|
|
31
|
+
* 销毁 toolbar
|
|
32
|
+
*/
|
|
33
|
+
destroy(): void;
|
|
34
|
+
}
|
|
35
|
+
export default Toolbar;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description base button class
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IButtonMenu, IDropPanelMenu, IModalMenu } from '../interface';
|
|
6
|
-
import { Dom7Array } from '../../utils/dom';
|
|
7
|
-
import { IBarItem } from './index';
|
|
8
|
-
declare abstract class BaseButton implements IBarItem {
|
|
9
|
-
readonly $elem: Dom7Array;
|
|
10
|
-
protected readonly $button: Dom7Array;
|
|
11
|
-
menu: IButtonMenu | IDropPanelMenu | IModalMenu;
|
|
12
|
-
private disabled;
|
|
13
|
-
constructor(key: string, menu: IButtonMenu | IDropPanelMenu | IModalMenu, inGroup?: boolean);
|
|
14
|
-
private init;
|
|
15
|
-
/**
|
|
16
|
-
* 执行 menu.exec
|
|
17
|
-
*/
|
|
18
|
-
private exec;
|
|
19
|
-
abstract onButtonClick(): void;
|
|
20
|
-
private setActive;
|
|
21
|
-
private setDisabled;
|
|
22
|
-
private setIcon;
|
|
23
|
-
private setTooltip;
|
|
24
|
-
changeMenuState(): void;
|
|
25
|
-
}
|
|
26
|
-
export default BaseButton;
|
|
1
|
+
/**
|
|
2
|
+
* @description base button class
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IButtonMenu, IDropPanelMenu, IModalMenu } from '../interface';
|
|
6
|
+
import { Dom7Array } from '../../utils/dom';
|
|
7
|
+
import { IBarItem } from './index';
|
|
8
|
+
declare abstract class BaseButton implements IBarItem {
|
|
9
|
+
readonly $elem: Dom7Array;
|
|
10
|
+
protected readonly $button: Dom7Array;
|
|
11
|
+
menu: IButtonMenu | IDropPanelMenu | IModalMenu;
|
|
12
|
+
private disabled;
|
|
13
|
+
constructor(key: string, menu: IButtonMenu | IDropPanelMenu | IModalMenu, inGroup?: boolean);
|
|
14
|
+
private init;
|
|
15
|
+
/**
|
|
16
|
+
* 执行 menu.exec
|
|
17
|
+
*/
|
|
18
|
+
private exec;
|
|
19
|
+
abstract onButtonClick(): void;
|
|
20
|
+
private setActive;
|
|
21
|
+
private setDisabled;
|
|
22
|
+
private setIcon;
|
|
23
|
+
private setTooltip;
|
|
24
|
+
changeMenuState(): void;
|
|
25
|
+
}
|
|
26
|
+
export default BaseButton;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description dropPanel button class
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDropPanelMenu } from '../interface';
|
|
6
|
-
import BaseButton from './BaseButton';
|
|
7
|
-
declare class DropPanelButton extends BaseButton {
|
|
8
|
-
private dropPanel;
|
|
9
|
-
menu: IDropPanelMenu;
|
|
10
|
-
constructor(key: string, menu: IDropPanelMenu, inGroup?: boolean);
|
|
11
|
-
onButtonClick(): void;
|
|
12
|
-
private handleDropPanel;
|
|
13
|
-
}
|
|
14
|
-
export default DropPanelButton;
|
|
1
|
+
/**
|
|
2
|
+
* @description dropPanel button class
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDropPanelMenu } from '../interface';
|
|
6
|
+
import BaseButton from './BaseButton';
|
|
7
|
+
declare class DropPanelButton extends BaseButton {
|
|
8
|
+
private dropPanel;
|
|
9
|
+
menu: IDropPanelMenu;
|
|
10
|
+
constructor(key: string, menu: IDropPanelMenu, inGroup?: boolean);
|
|
11
|
+
onButtonClick(): void;
|
|
12
|
+
private handleDropPanel;
|
|
13
|
+
}
|
|
14
|
+
export default DropPanelButton;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description group button class
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Dom7Array } from '../../utils/dom';
|
|
6
|
-
import { IMenuGroup } from '../interface';
|
|
7
|
-
import { IBarItem } from './index';
|
|
8
|
-
declare class GroupButton {
|
|
9
|
-
readonly $elem: Dom7Array;
|
|
10
|
-
private readonly $container;
|
|
11
|
-
readonly $button: Dom7Array;
|
|
12
|
-
constructor(menu: IMenuGroup);
|
|
13
|
-
appendBarItem(barItem: IBarItem): void;
|
|
14
|
-
private observe;
|
|
15
|
-
private createObserver;
|
|
16
|
-
}
|
|
17
|
-
export default GroupButton;
|
|
1
|
+
/**
|
|
2
|
+
* @description group button class
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Dom7Array } from '../../utils/dom';
|
|
6
|
+
import { IMenuGroup } from '../interface';
|
|
7
|
+
import { IBarItem } from './index';
|
|
8
|
+
declare class GroupButton {
|
|
9
|
+
readonly $elem: Dom7Array;
|
|
10
|
+
private readonly $container;
|
|
11
|
+
readonly $button: Dom7Array;
|
|
12
|
+
constructor(menu: IMenuGroup);
|
|
13
|
+
appendBarItem(barItem: IBarItem): void;
|
|
14
|
+
private observe;
|
|
15
|
+
private createObserver;
|
|
16
|
+
}
|
|
17
|
+
export default GroupButton;
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description modal button class
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IModalMenu } from '../interface';
|
|
6
|
-
import BaseButton from './BaseButton';
|
|
7
|
-
declare class ModalButton extends BaseButton {
|
|
8
|
-
private $body;
|
|
9
|
-
private modal;
|
|
10
|
-
menu: IModalMenu;
|
|
11
|
-
constructor(key: string, menu: IModalMenu, inGroup?: boolean);
|
|
12
|
-
onButtonClick(): void;
|
|
13
|
-
/**
|
|
14
|
-
* 获取 modal 定位
|
|
15
|
-
*/
|
|
16
|
-
private getPosition;
|
|
17
|
-
private handleModal;
|
|
18
|
-
/**
|
|
19
|
-
* 渲染并显示 modal
|
|
20
|
-
* @param modal modal
|
|
21
|
-
* @param firstTime 是否第一次显示 modal
|
|
22
|
-
*/
|
|
23
|
-
private renderAndShowModal;
|
|
24
|
-
}
|
|
25
|
-
export default ModalButton;
|
|
1
|
+
/**
|
|
2
|
+
* @description modal button class
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IModalMenu } from '../interface';
|
|
6
|
+
import BaseButton from './BaseButton';
|
|
7
|
+
declare class ModalButton extends BaseButton {
|
|
8
|
+
private $body;
|
|
9
|
+
private modal;
|
|
10
|
+
menu: IModalMenu;
|
|
11
|
+
constructor(key: string, menu: IModalMenu, inGroup?: boolean);
|
|
12
|
+
onButtonClick(): void;
|
|
13
|
+
/**
|
|
14
|
+
* 获取 modal 定位
|
|
15
|
+
*/
|
|
16
|
+
private getPosition;
|
|
17
|
+
private handleModal;
|
|
18
|
+
/**
|
|
19
|
+
* 渲染并显示 modal
|
|
20
|
+
* @param modal modal
|
|
21
|
+
* @param firstTime 是否第一次显示 modal
|
|
22
|
+
*/
|
|
23
|
+
private renderAndShowModal;
|
|
24
|
+
}
|
|
25
|
+
export default ModalButton;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description select
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Dom7Array } from '../../utils/dom';
|
|
6
|
-
import { IBarItem } from './index';
|
|
7
|
-
import { ISelectMenu } from '../interface';
|
|
8
|
-
declare class BarItemSelect implements IBarItem {
|
|
9
|
-
readonly $elem: Dom7Array;
|
|
10
|
-
private readonly $button;
|
|
11
|
-
menu: ISelectMenu;
|
|
12
|
-
private disabled;
|
|
13
|
-
private selectList;
|
|
14
|
-
constructor(key: string, menu: ISelectMenu, inGroup?: boolean);
|
|
15
|
-
private init;
|
|
16
|
-
private trigger;
|
|
17
|
-
private onChange;
|
|
18
|
-
private setSelectedValue;
|
|
19
|
-
private setDisabled;
|
|
20
|
-
changeMenuState(): void;
|
|
21
|
-
}
|
|
22
|
-
export default BarItemSelect;
|
|
1
|
+
/**
|
|
2
|
+
* @description select
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Dom7Array } from '../../utils/dom';
|
|
6
|
+
import { IBarItem } from './index';
|
|
7
|
+
import { ISelectMenu } from '../interface';
|
|
8
|
+
declare class BarItemSelect implements IBarItem {
|
|
9
|
+
readonly $elem: Dom7Array;
|
|
10
|
+
private readonly $button;
|
|
11
|
+
menu: ISelectMenu;
|
|
12
|
+
private disabled;
|
|
13
|
+
private selectList;
|
|
14
|
+
constructor(key: string, menu: ISelectMenu, inGroup?: boolean);
|
|
15
|
+
private init;
|
|
16
|
+
private trigger;
|
|
17
|
+
private onChange;
|
|
18
|
+
private setSelectedValue;
|
|
19
|
+
private setDisabled;
|
|
20
|
+
changeMenuState(): void;
|
|
21
|
+
}
|
|
22
|
+
export default BarItemSelect;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description button class
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IButtonMenu } from '../interface';
|
|
6
|
-
import BaseButton from './BaseButton';
|
|
7
|
-
declare class SimpleButton extends BaseButton {
|
|
8
|
-
constructor(key: string, menu: IButtonMenu, inGroup?: boolean);
|
|
9
|
-
onButtonClick(): void;
|
|
10
|
-
}
|
|
11
|
-
export default SimpleButton;
|
|
1
|
+
/**
|
|
2
|
+
* @description button class
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IButtonMenu } from '../interface';
|
|
6
|
+
import BaseButton from './BaseButton';
|
|
7
|
+
declare class SimpleButton extends BaseButton {
|
|
8
|
+
constructor(key: string, menu: IButtonMenu, inGroup?: boolean);
|
|
9
|
+
onButtonClick(): void;
|
|
10
|
+
}
|
|
11
|
+
export default SimpleButton;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description bar item
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Dom7Array } from '../../utils/dom';
|
|
6
|
-
import { IButtonMenu, ISelectMenu, IDropPanelMenu, IModalMenu, IMenuGroup } from '../interface';
|
|
7
|
-
import { IDomEditor } from '../../editor/interface';
|
|
8
|
-
import GroupButton from './GroupButton';
|
|
9
|
-
type MenuType = IButtonMenu | ISelectMenu | IDropPanelMenu | IModalMenu;
|
|
10
|
-
export interface IBarItem {
|
|
11
|
-
$elem: Dom7Array;
|
|
12
|
-
menu: MenuType;
|
|
13
|
-
changeMenuState: () => void;
|
|
14
|
-
}
|
|
15
|
-
export declare function getEditorInstance(item: IBarItem): IDomEditor;
|
|
16
|
-
/**
|
|
17
|
-
* 创建 bar button/select
|
|
18
|
-
* @param key menu key
|
|
19
|
-
* @param menu menu
|
|
20
|
-
* @param inGroup 在 groupButton 中
|
|
21
|
-
*/
|
|
22
|
-
export declare function createBarItem(key: string, menu: MenuType, inGroup?: boolean): IBarItem;
|
|
23
|
-
export declare function createBarItemGroup(menu: IMenuGroup): GroupButton;
|
|
24
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @description bar item
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Dom7Array } from '../../utils/dom';
|
|
6
|
+
import { IButtonMenu, ISelectMenu, IDropPanelMenu, IModalMenu, IMenuGroup } from '../interface';
|
|
7
|
+
import { IDomEditor } from '../../editor/interface';
|
|
8
|
+
import GroupButton from './GroupButton';
|
|
9
|
+
type MenuType = IButtonMenu | ISelectMenu | IDropPanelMenu | IModalMenu;
|
|
10
|
+
export interface IBarItem {
|
|
11
|
+
$elem: Dom7Array;
|
|
12
|
+
menu: MenuType;
|
|
13
|
+
changeMenuState: () => void;
|
|
14
|
+
}
|
|
15
|
+
export declare function getEditorInstance(item: IBarItem): IDomEditor;
|
|
16
|
+
/**
|
|
17
|
+
* 创建 bar button/select
|
|
18
|
+
* @param key menu key
|
|
19
|
+
* @param menu menu
|
|
20
|
+
* @param inGroup 在 groupButton 中
|
|
21
|
+
*/
|
|
22
|
+
export declare function createBarItem(key: string, menu: MenuType, inGroup?: boolean): IBarItem;
|
|
23
|
+
export declare function createBarItemGroup(menu: IMenuGroup): GroupButton;
|
|
24
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description tooltip 功能
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Dom7Array } from '../../utils/dom';
|
|
6
|
-
export declare function addTooltip($button: Dom7Array, iconSvg: string, title: string, hotkey?: string, inGroup?: boolean): void;
|
|
1
|
+
/**
|
|
2
|
+
* @description tooltip 功能
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Dom7Array } from '../../utils/dom';
|
|
6
|
+
export declare function addTooltip($button: Dom7Array, iconSvg: string, title: string, hotkey?: string, inGroup?: boolean): void;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description menu helpers
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Dom7Array } from '../../utils/dom';
|
|
6
|
-
/**
|
|
7
|
-
* 清理 svg 的样式
|
|
8
|
-
* @param $elem svg elem
|
|
9
|
-
*/
|
|
10
|
-
export declare function clearSvgStyle($elem: Dom7Array): void;
|
|
11
|
-
/**
|
|
12
|
-
* 向下箭头 icon svg
|
|
13
|
-
*/
|
|
14
|
-
export declare function gen$downArrow(): Dom7Array;
|
|
15
|
-
/**
|
|
16
|
-
* bar item 分割线
|
|
17
|
-
*/
|
|
18
|
-
export declare function gen$barItemDivider(): Dom7Array;
|
|
1
|
+
/**
|
|
2
|
+
* @description menu helpers
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Dom7Array } from '../../utils/dom';
|
|
6
|
+
/**
|
|
7
|
+
* 清理 svg 的样式
|
|
8
|
+
* @param $elem svg elem
|
|
9
|
+
*/
|
|
10
|
+
export declare function clearSvgStyle($elem: Dom7Array): void;
|
|
11
|
+
/**
|
|
12
|
+
* 向下箭头 icon svg
|
|
13
|
+
*/
|
|
14
|
+
export declare function gen$downArrow(): Dom7Array;
|
|
15
|
+
/**
|
|
16
|
+
* bar item 分割线
|
|
17
|
+
*/
|
|
18
|
+
export declare function gen$barItemDivider(): Dom7Array;
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description menu position helpers
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Node } from 'slate';
|
|
6
|
-
import { Dom7Array } from '../../utils/dom';
|
|
7
|
-
import { IDomEditor } from '../../editor/interface';
|
|
8
|
-
import { IPositionStyle } from '../interface';
|
|
9
|
-
/**
|
|
10
|
-
* 获取 textContainer 尺寸和定位
|
|
11
|
-
* @param editor editor
|
|
12
|
-
*/
|
|
13
|
-
export declare function getTextContainerRect(editor: IDomEditor): {
|
|
14
|
-
top: number;
|
|
15
|
-
left: number;
|
|
16
|
-
width: number;
|
|
17
|
-
height: number;
|
|
18
|
-
} | null;
|
|
19
|
-
/**
|
|
20
|
-
* 根据选区,计算定位(用于 modal hoverbar)
|
|
21
|
-
* @param editor editor
|
|
22
|
-
*/
|
|
23
|
-
export declare function getPositionBySelection(editor: IDomEditor): Partial<IPositionStyle>;
|
|
24
|
-
/**
|
|
25
|
-
* 根据 node ,计算定位(用于 modal hoverbar)
|
|
26
|
-
* @param editor editor
|
|
27
|
-
* @param node slate node
|
|
28
|
-
* @param type 'modal'/'bar'
|
|
29
|
-
*/
|
|
30
|
-
export declare function getPositionByNode(editor: IDomEditor, node: Node, type?: string): Partial<IPositionStyle>;
|
|
31
|
-
/**
|
|
32
|
-
* 异步修正 position ,不能超出 textContainer 边界
|
|
33
|
-
* @param editor editor
|
|
34
|
-
* @param $positionElem modal/bar
|
|
35
|
-
*/
|
|
36
|
-
export declare function correctPosition(editor: IDomEditor, $positionElem: Dom7Array): void;
|
|
1
|
+
/**
|
|
2
|
+
* @description menu position helpers
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Node } from 'slate';
|
|
6
|
+
import { Dom7Array } from '../../utils/dom';
|
|
7
|
+
import { IDomEditor } from '../../editor/interface';
|
|
8
|
+
import { IPositionStyle } from '../interface';
|
|
9
|
+
/**
|
|
10
|
+
* 获取 textContainer 尺寸和定位
|
|
11
|
+
* @param editor editor
|
|
12
|
+
*/
|
|
13
|
+
export declare function getTextContainerRect(editor: IDomEditor): {
|
|
14
|
+
top: number;
|
|
15
|
+
left: number;
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
} | null;
|
|
19
|
+
/**
|
|
20
|
+
* 根据选区,计算定位(用于 modal hoverbar)
|
|
21
|
+
* @param editor editor
|
|
22
|
+
*/
|
|
23
|
+
export declare function getPositionBySelection(editor: IDomEditor): Partial<IPositionStyle>;
|
|
24
|
+
/**
|
|
25
|
+
* 根据 node ,计算定位(用于 modal hoverbar)
|
|
26
|
+
* @param editor editor
|
|
27
|
+
* @param node slate node
|
|
28
|
+
* @param type 'modal'/'bar'
|
|
29
|
+
*/
|
|
30
|
+
export declare function getPositionByNode(editor: IDomEditor, node: Node, type?: string): Partial<IPositionStyle>;
|
|
31
|
+
/**
|
|
32
|
+
* 异步修正 position ,不能超出 textContainer 边界
|
|
33
|
+
* @param editor editor
|
|
34
|
+
* @param $positionElem modal/bar
|
|
35
|
+
*/
|
|
36
|
+
export declare function correctPosition(editor: IDomEditor, $positionElem: Dom7Array): void;
|