@wangeditor-next/core 1.7.6 → 1.7.8
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
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description menus entry
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import Toolbar from './bar/Toolbar';
|
|
6
|
-
export { registerMenu } from './register';
|
|
7
|
-
export { IButtonMenu, ISelectMenu, IDropPanelMenu, IModalMenu, IRegisterMenuConf, IOption, } from './interface';
|
|
8
|
-
export { genModalInputElems, genModalButtonElems, genModalTextareaElems, } from './panel-and-modal/Modal';
|
|
9
|
-
export { Toolbar };
|
|
1
|
+
/**
|
|
2
|
+
* @description menus entry
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import Toolbar from './bar/Toolbar';
|
|
6
|
+
export { registerMenu } from './register';
|
|
7
|
+
export { IButtonMenu, ISelectMenu, IDropPanelMenu, IModalMenu, IRegisterMenuConf, IOption, } from './interface';
|
|
8
|
+
export { genModalInputElems, genModalButtonElems, genModalTextareaElems, } from './panel-and-modal/Modal';
|
|
9
|
+
export { Toolbar };
|
|
@@ -1,66 +1,66 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description menu interface
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Node } from 'slate';
|
|
6
|
-
import { IDomEditor } from '../editor/interface';
|
|
7
|
-
import { DOMElement } from '../utils/dom';
|
|
8
|
-
export interface IMenuGroup {
|
|
9
|
-
key: string;
|
|
10
|
-
title: string;
|
|
11
|
-
iconSvg?: string;
|
|
12
|
-
menuKeys: string[];
|
|
13
|
-
}
|
|
14
|
-
export interface IPositionStyle {
|
|
15
|
-
top: string;
|
|
16
|
-
left: string;
|
|
17
|
-
right: string;
|
|
18
|
-
bottom: string;
|
|
19
|
-
}
|
|
20
|
-
export interface IOption {
|
|
21
|
-
value: string;
|
|
22
|
-
text: string;
|
|
23
|
-
selected?: boolean;
|
|
24
|
-
styleForRenderMenuList?: {
|
|
25
|
-
[key: string]: string;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
interface IBaseMenu {
|
|
29
|
-
readonly title: string;
|
|
30
|
-
iconSvg?: string;
|
|
31
|
-
readonly hotkey?: string;
|
|
32
|
-
readonly alwaysEnable?: boolean;
|
|
33
|
-
readonly tag: string;
|
|
34
|
-
readonly width?: number;
|
|
35
|
-
getValue: (editor: IDomEditor) => string | boolean;
|
|
36
|
-
getIcon?: (editor: IDomEditor) => string;
|
|
37
|
-
getTitle?: (editor: IDomEditor) => string;
|
|
38
|
-
isActive: (editor: IDomEditor) => boolean;
|
|
39
|
-
isDisabled: (editor: IDomEditor) => boolean;
|
|
40
|
-
exec: (editor: IDomEditor, value: string | boolean) => void;
|
|
41
|
-
}
|
|
42
|
-
export interface IButtonMenu extends IBaseMenu {
|
|
43
|
-
}
|
|
44
|
-
export interface ISelectMenu extends IBaseMenu {
|
|
45
|
-
readonly selectPanelWidth?: number;
|
|
46
|
-
getOptions: (editor: IDomEditor) => IOption[];
|
|
47
|
-
}
|
|
48
|
-
export interface IDropPanelMenu extends IBaseMenu {
|
|
49
|
-
readonly showDropPanel: boolean;
|
|
50
|
-
getPanelContentElem: (editor: IDomEditor) => DOMElement;
|
|
51
|
-
}
|
|
52
|
-
export interface IModalMenu extends IBaseMenu {
|
|
53
|
-
readonly showModal: boolean;
|
|
54
|
-
readonly modalWidth: number;
|
|
55
|
-
getModalContentElem: (editor: IDomEditor) => DOMElement;
|
|
56
|
-
getModalPositionNode: (editor: IDomEditor) => Node | null;
|
|
57
|
-
}
|
|
58
|
-
export type MenuFactoryType = () => IButtonMenu | ISelectMenu | IDropPanelMenu | IModalMenu;
|
|
59
|
-
export interface IRegisterMenuConf {
|
|
60
|
-
key: string;
|
|
61
|
-
factory: MenuFactoryType;
|
|
62
|
-
config?: {
|
|
63
|
-
[key: string]: any;
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @description menu interface
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Node } from 'slate';
|
|
6
|
+
import { IDomEditor } from '../editor/interface';
|
|
7
|
+
import { DOMElement } from '../utils/dom';
|
|
8
|
+
export interface IMenuGroup {
|
|
9
|
+
key: string;
|
|
10
|
+
title: string;
|
|
11
|
+
iconSvg?: string;
|
|
12
|
+
menuKeys: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface IPositionStyle {
|
|
15
|
+
top: string;
|
|
16
|
+
left: string;
|
|
17
|
+
right: string;
|
|
18
|
+
bottom: string;
|
|
19
|
+
}
|
|
20
|
+
export interface IOption {
|
|
21
|
+
value: string;
|
|
22
|
+
text: string;
|
|
23
|
+
selected?: boolean;
|
|
24
|
+
styleForRenderMenuList?: {
|
|
25
|
+
[key: string]: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
interface IBaseMenu {
|
|
29
|
+
readonly title: string;
|
|
30
|
+
iconSvg?: string;
|
|
31
|
+
readonly hotkey?: string;
|
|
32
|
+
readonly alwaysEnable?: boolean;
|
|
33
|
+
readonly tag: string;
|
|
34
|
+
readonly width?: number;
|
|
35
|
+
getValue: (editor: IDomEditor) => string | boolean;
|
|
36
|
+
getIcon?: (editor: IDomEditor) => string;
|
|
37
|
+
getTitle?: (editor: IDomEditor) => string;
|
|
38
|
+
isActive: (editor: IDomEditor) => boolean;
|
|
39
|
+
isDisabled: (editor: IDomEditor) => boolean;
|
|
40
|
+
exec: (editor: IDomEditor, value: string | boolean) => void;
|
|
41
|
+
}
|
|
42
|
+
export interface IButtonMenu extends IBaseMenu {
|
|
43
|
+
}
|
|
44
|
+
export interface ISelectMenu extends IBaseMenu {
|
|
45
|
+
readonly selectPanelWidth?: number;
|
|
46
|
+
getOptions: (editor: IDomEditor) => IOption[];
|
|
47
|
+
}
|
|
48
|
+
export interface IDropPanelMenu extends IBaseMenu {
|
|
49
|
+
readonly showDropPanel: boolean;
|
|
50
|
+
getPanelContentElem: (editor: IDomEditor) => DOMElement;
|
|
51
|
+
}
|
|
52
|
+
export interface IModalMenu extends IBaseMenu {
|
|
53
|
+
readonly showModal: boolean;
|
|
54
|
+
readonly modalWidth: number;
|
|
55
|
+
getModalContentElem: (editor: IDomEditor) => DOMElement;
|
|
56
|
+
getModalPositionNode: (editor: IDomEditor) => Node | null;
|
|
57
|
+
}
|
|
58
|
+
export type MenuFactoryType = () => IButtonMenu | ISelectMenu | IDropPanelMenu | IModalMenu;
|
|
59
|
+
export interface IRegisterMenuConf {
|
|
60
|
+
key: string;
|
|
61
|
+
factory: MenuFactoryType;
|
|
62
|
+
config?: {
|
|
63
|
+
[key: string]: any;
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description panel modal baseClass
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDomEditor } from '../../editor/interface';
|
|
6
|
-
import { Dom7Array, DOMElement } from '../../utils/dom';
|
|
7
|
-
declare abstract class PanelAndModal {
|
|
8
|
-
abstract readonly type: string;
|
|
9
|
-
abstract readonly $elem: Dom7Array;
|
|
10
|
-
isShow: boolean;
|
|
11
|
-
private showTime;
|
|
12
|
-
constructor(editor: IDomEditor);
|
|
13
|
-
/**
|
|
14
|
-
* 记录下来,以便隐藏,API editor.hidePanelOrModal
|
|
15
|
-
*/
|
|
16
|
-
private record;
|
|
17
|
-
/**
|
|
18
|
-
* 除了 content 之外的其他自己要增加的 elem
|
|
19
|
-
*/
|
|
20
|
-
abstract genSelfElem(): Dom7Array | null;
|
|
21
|
-
renderContent(contentElem: DOMElement): void;
|
|
22
|
-
appendTo($menuElem: Dom7Array): void;
|
|
23
|
-
show(): void;
|
|
24
|
-
hide(): void;
|
|
25
|
-
}
|
|
26
|
-
export default PanelAndModal;
|
|
1
|
+
/**
|
|
2
|
+
* @description panel modal baseClass
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor } from '../../editor/interface';
|
|
6
|
+
import { Dom7Array, DOMElement } from '../../utils/dom';
|
|
7
|
+
declare abstract class PanelAndModal {
|
|
8
|
+
abstract readonly type: string;
|
|
9
|
+
abstract readonly $elem: Dom7Array;
|
|
10
|
+
isShow: boolean;
|
|
11
|
+
private showTime;
|
|
12
|
+
constructor(editor: IDomEditor);
|
|
13
|
+
/**
|
|
14
|
+
* 记录下来,以便隐藏,API editor.hidePanelOrModal
|
|
15
|
+
*/
|
|
16
|
+
private record;
|
|
17
|
+
/**
|
|
18
|
+
* 除了 content 之外的其他自己要增加的 elem
|
|
19
|
+
*/
|
|
20
|
+
abstract genSelfElem(): Dom7Array | null;
|
|
21
|
+
renderContent(contentElem: DOMElement): void;
|
|
22
|
+
appendTo($menuElem: Dom7Array): void;
|
|
23
|
+
show(): void;
|
|
24
|
+
hide(): void;
|
|
25
|
+
}
|
|
26
|
+
export default PanelAndModal;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description dropPanel class
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDomEditor } from '../../editor/interface';
|
|
6
|
-
import { Dom7Array } from '../../utils/dom';
|
|
7
|
-
import PanelAndModal from './BaseClass';
|
|
8
|
-
declare class DropPanel extends PanelAndModal {
|
|
9
|
-
type: string;
|
|
10
|
-
readonly $elem: Dom7Array;
|
|
11
|
-
constructor(editor: IDomEditor);
|
|
12
|
-
genSelfElem(): Dom7Array | null;
|
|
13
|
-
}
|
|
14
|
-
export default DropPanel;
|
|
1
|
+
/**
|
|
2
|
+
* @description dropPanel class
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor } from '../../editor/interface';
|
|
6
|
+
import { Dom7Array } from '../../utils/dom';
|
|
7
|
+
import PanelAndModal from './BaseClass';
|
|
8
|
+
declare class DropPanel extends PanelAndModal {
|
|
9
|
+
type: string;
|
|
10
|
+
readonly $elem: Dom7Array;
|
|
11
|
+
constructor(editor: IDomEditor);
|
|
12
|
+
genSelfElem(): Dom7Array | null;
|
|
13
|
+
}
|
|
14
|
+
export default DropPanel;
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description modal class
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Dom7Array, DOMElement } from '../../utils/dom';
|
|
6
|
-
import { IPositionStyle } from '../interface';
|
|
7
|
-
import PanelAndModal from './BaseClass';
|
|
8
|
-
import { IDomEditor } from '../../editor/interface';
|
|
9
|
-
declare class Modal extends PanelAndModal {
|
|
10
|
-
type: string;
|
|
11
|
-
readonly $elem: Dom7Array;
|
|
12
|
-
private width;
|
|
13
|
-
constructor(editor: IDomEditor, width?: number);
|
|
14
|
-
/**
|
|
15
|
-
* 生成要添加到 modal $elem 的元素
|
|
16
|
-
* 【注意】不要直接 append 到 modal $elem ,因为它每次都会清空 html('')
|
|
17
|
-
*/
|
|
18
|
-
genSelfElem(): Dom7Array | null;
|
|
19
|
-
setStyle(positionStyle: Partial<IPositionStyle>): void;
|
|
20
|
-
}
|
|
21
|
-
export default Modal;
|
|
22
|
-
/**
|
|
23
|
-
* 生成 modal input elems
|
|
24
|
-
* @param labelText label text
|
|
25
|
-
* @param inputId input dom id
|
|
26
|
-
* @param placeholder input placeholder
|
|
27
|
-
* @returns [$container, $input]
|
|
28
|
-
*/
|
|
29
|
-
export declare function genModalInputElems(labelText: string, inputId: string, placeholder?: string): DOMElement[];
|
|
30
|
-
/**
|
|
31
|
-
* 生成 modal textarea elems
|
|
32
|
-
* @param labelText label text
|
|
33
|
-
* @param textareaId input dom id
|
|
34
|
-
* @param placeholder input placeholder
|
|
35
|
-
* @returns [$container, $textarea]
|
|
36
|
-
*/
|
|
37
|
-
export declare function genModalTextareaElems(labelText: string, textareaId: string, placeholder?: string): DOMElement[];
|
|
38
|
-
/**
|
|
39
|
-
* 生成 modal button elems
|
|
40
|
-
* @param buttonId button dom id
|
|
41
|
-
* @param buttonText button text
|
|
42
|
-
* @returns [ $container, $button ]
|
|
43
|
-
*/
|
|
44
|
-
export declare function genModalButtonElems(buttonId: string, buttonText: string): DOMElement[];
|
|
1
|
+
/**
|
|
2
|
+
* @description modal class
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Dom7Array, DOMElement } from '../../utils/dom';
|
|
6
|
+
import { IPositionStyle } from '../interface';
|
|
7
|
+
import PanelAndModal from './BaseClass';
|
|
8
|
+
import { IDomEditor } from '../../editor/interface';
|
|
9
|
+
declare class Modal extends PanelAndModal {
|
|
10
|
+
type: string;
|
|
11
|
+
readonly $elem: Dom7Array;
|
|
12
|
+
private width;
|
|
13
|
+
constructor(editor: IDomEditor, width?: number);
|
|
14
|
+
/**
|
|
15
|
+
* 生成要添加到 modal $elem 的元素
|
|
16
|
+
* 【注意】不要直接 append 到 modal $elem ,因为它每次都会清空 html('')
|
|
17
|
+
*/
|
|
18
|
+
genSelfElem(): Dom7Array | null;
|
|
19
|
+
setStyle(positionStyle: Partial<IPositionStyle>): void;
|
|
20
|
+
}
|
|
21
|
+
export default Modal;
|
|
22
|
+
/**
|
|
23
|
+
* 生成 modal input elems
|
|
24
|
+
* @param labelText label text
|
|
25
|
+
* @param inputId input dom id
|
|
26
|
+
* @param placeholder input placeholder
|
|
27
|
+
* @returns [$container, $input]
|
|
28
|
+
*/
|
|
29
|
+
export declare function genModalInputElems(labelText: string, inputId: string, placeholder?: string): DOMElement[];
|
|
30
|
+
/**
|
|
31
|
+
* 生成 modal textarea elems
|
|
32
|
+
* @param labelText label text
|
|
33
|
+
* @param textareaId input dom id
|
|
34
|
+
* @param placeholder input placeholder
|
|
35
|
+
* @returns [$container, $textarea]
|
|
36
|
+
*/
|
|
37
|
+
export declare function genModalTextareaElems(labelText: string, textareaId: string, placeholder?: string): DOMElement[];
|
|
38
|
+
/**
|
|
39
|
+
* 生成 modal button elems
|
|
40
|
+
* @param buttonId button dom id
|
|
41
|
+
* @param buttonText button text
|
|
42
|
+
* @returns [ $container, $button ]
|
|
43
|
+
*/
|
|
44
|
+
export declare function genModalButtonElems(buttonId: string, buttonText: string): DOMElement[];
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description SelectList class
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Dom7Array } from '../../utils/dom';
|
|
6
|
-
import { IOption } from '../interface';
|
|
7
|
-
import PanelAndModal from './BaseClass';
|
|
8
|
-
import { IDomEditor } from '../../editor/interface';
|
|
9
|
-
declare class SelectList extends PanelAndModal {
|
|
10
|
-
type: string;
|
|
11
|
-
readonly $elem: Dom7Array;
|
|
12
|
-
constructor(editor: IDomEditor, width?: number);
|
|
13
|
-
/**
|
|
14
|
-
* 渲染 list
|
|
15
|
-
* @param options select options
|
|
16
|
-
*/
|
|
17
|
-
renderList(options: IOption[]): void;
|
|
18
|
-
genSelfElem(): Dom7Array | null;
|
|
19
|
-
}
|
|
20
|
-
export default SelectList;
|
|
1
|
+
/**
|
|
2
|
+
* @description SelectList class
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Dom7Array } from '../../utils/dom';
|
|
6
|
+
import { IOption } from '../interface';
|
|
7
|
+
import PanelAndModal from './BaseClass';
|
|
8
|
+
import { IDomEditor } from '../../editor/interface';
|
|
9
|
+
declare class SelectList extends PanelAndModal {
|
|
10
|
+
type: string;
|
|
11
|
+
readonly $elem: Dom7Array;
|
|
12
|
+
constructor(editor: IDomEditor, width?: number);
|
|
13
|
+
/**
|
|
14
|
+
* 渲染 list
|
|
15
|
+
* @param options select options
|
|
16
|
+
*/
|
|
17
|
+
renderList(options: IOption[]): void;
|
|
18
|
+
genSelfElem(): Dom7Array | null;
|
|
19
|
+
}
|
|
20
|
+
export default SelectList;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description register menu
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { MenuFactoryType, IRegisterMenuConf } from './interface';
|
|
6
|
-
export declare const MENU_ITEM_FACTORIES: {
|
|
7
|
-
[key: string]: MenuFactoryType;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* 注册菜单配置
|
|
11
|
-
* @param registerMenuConf { key, factory, config } ,各个 menu key 不能重复
|
|
12
|
-
* @param customConfig 自定义 menu config
|
|
13
|
-
*/
|
|
14
|
-
export declare function registerMenu(registerMenuConf: IRegisterMenuConf, customConfig?: {
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
}): void;
|
|
1
|
+
/**
|
|
2
|
+
* @description register menu
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { MenuFactoryType, IRegisterMenuConf } from './interface';
|
|
6
|
+
export declare const MENU_ITEM_FACTORIES: {
|
|
7
|
+
[key: string]: MenuFactoryType;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* 注册菜单配置
|
|
11
|
+
* @param registerMenuConf { key, factory, config } ,各个 menu key 不能重复
|
|
12
|
+
* @param customConfig 自定义 menu config
|
|
13
|
+
*/
|
|
14
|
+
export declare function registerMenu(registerMenuConf: IRegisterMenuConf, customConfig?: {
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}): void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description parse-html helper fns
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* 把 charCode 160 的空格(` ` 转换的),替换为 charCode 32 的空格(JS 默认的)
|
|
7
|
-
* @param str str
|
|
8
|
-
* @returns str
|
|
9
|
-
*/
|
|
10
|
-
export declare function replaceSpace160(str: string): string;
|
|
1
|
+
/**
|
|
2
|
+
* @description parse-html helper fns
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 把 charCode 160 的空格(` ` 转换的),替换为 charCode 32 的空格(JS 默认的)
|
|
7
|
+
* @param str str
|
|
8
|
+
* @returns str
|
|
9
|
+
*/
|
|
10
|
+
export declare function replaceSpace160(str: string): string;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description parse html
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { DOMElement } from '../utils/dom';
|
|
6
|
-
import { Element as SlateElement, Descendant } from 'slate';
|
|
7
|
-
import { IDomEditor } from '../editor/interface';
|
|
8
|
-
export declare const TEXT_TAGS: string[];
|
|
9
|
-
export type PreParseHtmlFnType = ($node: DOMElement) => DOMElement;
|
|
10
|
-
export interface IPreParseHtmlConf {
|
|
11
|
-
selector: string;
|
|
12
|
-
preParseHtml: PreParseHtmlFnType;
|
|
13
|
-
}
|
|
14
|
-
export declare const PRE_PARSE_HTML_CONF_LIST: IPreParseHtmlConf[];
|
|
15
|
-
/**
|
|
16
|
-
* 注册 pre-parse html 配置
|
|
17
|
-
* @param conf pre-parse html conf
|
|
18
|
-
*/
|
|
19
|
-
export declare function registerPreParseHtmlConf(conf: IPreParseHtmlConf): void;
|
|
20
|
-
export type ParseStyleHtmlFnType = ($node: DOMElement, node: Descendant, editor: IDomEditor) => Descendant;
|
|
21
|
-
export declare const PARSE_STYLE_HTML_FN_LIST: ParseStyleHtmlFnType[];
|
|
22
|
-
/**
|
|
23
|
-
* 注册 parseStyleHtml 函数
|
|
24
|
-
* @param fn parse style html 的函数
|
|
25
|
-
*/
|
|
26
|
-
export declare function registerParseStyleHtmlHandler(fn: ParseStyleHtmlFnType): void;
|
|
27
|
-
export type ParseElemHtmlFnType = ($elem: DOMElement, children: Descendant[], editor: IDomEditor) => SlateElement | SlateElement[];
|
|
28
|
-
export declare const PARSE_ELEM_HTML_CONF: {
|
|
29
|
-
[key: string]: ParseElemHtmlFnType;
|
|
30
|
-
};
|
|
31
|
-
export interface IParseElemHtmlConf {
|
|
32
|
-
selector: string;
|
|
33
|
-
parseElemHtml: ParseElemHtmlFnType;
|
|
34
|
-
}
|
|
35
|
-
export declare function registerParseElemHtmlConf(conf: IParseElemHtmlConf): void;
|
|
1
|
+
/**
|
|
2
|
+
* @description parse html
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { DOMElement } from '../utils/dom';
|
|
6
|
+
import { Element as SlateElement, Descendant } from 'slate';
|
|
7
|
+
import { IDomEditor } from '../editor/interface';
|
|
8
|
+
export declare const TEXT_TAGS: string[];
|
|
9
|
+
export type PreParseHtmlFnType = ($node: DOMElement) => DOMElement;
|
|
10
|
+
export interface IPreParseHtmlConf {
|
|
11
|
+
selector: string;
|
|
12
|
+
preParseHtml: PreParseHtmlFnType;
|
|
13
|
+
}
|
|
14
|
+
export declare const PRE_PARSE_HTML_CONF_LIST: IPreParseHtmlConf[];
|
|
15
|
+
/**
|
|
16
|
+
* 注册 pre-parse html 配置
|
|
17
|
+
* @param conf pre-parse html conf
|
|
18
|
+
*/
|
|
19
|
+
export declare function registerPreParseHtmlConf(conf: IPreParseHtmlConf): void;
|
|
20
|
+
export type ParseStyleHtmlFnType = ($node: DOMElement, node: Descendant, editor: IDomEditor) => Descendant;
|
|
21
|
+
export declare const PARSE_STYLE_HTML_FN_LIST: ParseStyleHtmlFnType[];
|
|
22
|
+
/**
|
|
23
|
+
* 注册 parseStyleHtml 函数
|
|
24
|
+
* @param fn parse style html 的函数
|
|
25
|
+
*/
|
|
26
|
+
export declare function registerParseStyleHtmlHandler(fn: ParseStyleHtmlFnType): void;
|
|
27
|
+
export type ParseElemHtmlFnType = ($elem: DOMElement, children: Descendant[], editor: IDomEditor) => SlateElement | SlateElement[];
|
|
28
|
+
export declare const PARSE_ELEM_HTML_CONF: {
|
|
29
|
+
[key: string]: ParseElemHtmlFnType;
|
|
30
|
+
};
|
|
31
|
+
export interface IParseElemHtmlConf {
|
|
32
|
+
selector: string;
|
|
33
|
+
parseElemHtml: ParseElemHtmlFnType;
|
|
34
|
+
}
|
|
35
|
+
export declare function registerParseElemHtmlConf(conf: IParseElemHtmlConf): void;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description parse elem html
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Dom7Array } from 'dom7';
|
|
6
|
-
import { Element } from 'slate';
|
|
7
|
-
import { IDomEditor } from '../editor/interface';
|
|
8
|
-
/**
|
|
9
|
-
* 处理普通 DOM elem html ,非 span font 等文本 elem
|
|
10
|
-
* @param $elem $elem
|
|
11
|
-
* @param editor editor
|
|
12
|
-
* @returns slate element
|
|
13
|
-
*/
|
|
14
|
-
declare function parseCommonElemHtml($elem: Dom7Array, editor: IDomEditor): Element[];
|
|
15
|
-
export default parseCommonElemHtml;
|
|
1
|
+
/**
|
|
2
|
+
* @description parse elem html
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Dom7Array } from 'dom7';
|
|
6
|
+
import { Element } from 'slate';
|
|
7
|
+
import { IDomEditor } from '../editor/interface';
|
|
8
|
+
/**
|
|
9
|
+
* 处理普通 DOM elem html ,非 span font 等文本 elem
|
|
10
|
+
* @param $elem $elem
|
|
11
|
+
* @param editor editor
|
|
12
|
+
* @returns slate element
|
|
13
|
+
*/
|
|
14
|
+
declare function parseCommonElemHtml($elem: Dom7Array, editor: IDomEditor): Element[];
|
|
15
|
+
export default parseCommonElemHtml;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description parse node html
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Dom7Array } from 'dom7';
|
|
6
|
-
import { Descendant } from 'slate';
|
|
7
|
-
import { IDomEditor } from '../editor/interface';
|
|
8
|
-
/**
|
|
9
|
-
* 处理 DOM Elem html
|
|
10
|
-
* @param $elem $elem
|
|
11
|
-
* @param editor editor
|
|
12
|
-
* @returns slate Descendant
|
|
13
|
-
*/
|
|
14
|
-
declare function parseElemHtml($elem: Dom7Array, editor: IDomEditor): Descendant | Descendant[];
|
|
15
|
-
export default parseElemHtml;
|
|
1
|
+
/**
|
|
2
|
+
* @description parse node html
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Dom7Array } from 'dom7';
|
|
6
|
+
import { Descendant } from 'slate';
|
|
7
|
+
import { IDomEditor } from '../editor/interface';
|
|
8
|
+
/**
|
|
9
|
+
* 处理 DOM Elem html
|
|
10
|
+
* @param $elem $elem
|
|
11
|
+
* @param editor editor
|
|
12
|
+
* @returns slate Descendant
|
|
13
|
+
*/
|
|
14
|
+
declare function parseElemHtml($elem: Dom7Array, editor: IDomEditor): Descendant | Descendant[];
|
|
15
|
+
export default parseElemHtml;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description parse text html
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Dom7Array } from 'dom7';
|
|
6
|
-
import { Text } from 'slate';
|
|
7
|
-
import { IDomEditor } from '../editor/interface';
|
|
8
|
-
/**
|
|
9
|
-
* 处理 text elem ,如 <span> <strong> <em> 等(并不是 DOM Text Node)
|
|
10
|
-
* @param $text $text
|
|
11
|
-
* @param editor editor
|
|
12
|
-
* @returns slate text
|
|
13
|
-
*/
|
|
14
|
-
declare function parseTextElemHtml($text: Dom7Array, editor: IDomEditor): Text;
|
|
15
|
-
export default parseTextElemHtml;
|
|
1
|
+
/**
|
|
2
|
+
* @description parse text html
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Dom7Array } from 'dom7';
|
|
6
|
+
import { Text } from 'slate';
|
|
7
|
+
import { IDomEditor } from '../editor/interface';
|
|
8
|
+
/**
|
|
9
|
+
* 处理 text elem ,如 <span> <strong> <em> 等(并不是 DOM Text Node)
|
|
10
|
+
* @param $text $text
|
|
11
|
+
* @param editor editor
|
|
12
|
+
* @returns slate text
|
|
13
|
+
*/
|
|
14
|
+
declare function parseTextElemHtml($text: Dom7Array, editor: IDomEditor): Text;
|
|
15
|
+
export default parseTextElemHtml;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 获取 elem render 函数
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { RenderElemFnType } from '../index';
|
|
6
|
-
/**
|
|
7
|
-
* 根据 elemNode.type 获取 renderElement 函数
|
|
8
|
-
* @param type elemNode.type
|
|
9
|
-
*/
|
|
10
|
-
declare function getRenderElem(type: string): RenderElemFnType;
|
|
11
|
-
export default getRenderElem;
|
|
1
|
+
/**
|
|
2
|
+
* @description 获取 elem render 函数
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { RenderElemFnType } from '../index';
|
|
6
|
+
/**
|
|
7
|
+
* 根据 elemNode.type 获取 renderElement 函数
|
|
8
|
+
* @param type elemNode.type
|
|
9
|
+
*/
|
|
10
|
+
declare function getRenderElem(type: string): RenderElemFnType;
|
|
11
|
+
export default getRenderElem;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description render element node
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Element as SlateElement } from 'slate';
|
|
6
|
-
import { VNode } from 'snabbdom';
|
|
7
|
-
import { IDomEditor } from '../../editor/interface';
|
|
8
|
-
declare function renderElement(elemNode: SlateElement, editor: IDomEditor): VNode;
|
|
9
|
-
export default renderElement;
|
|
1
|
+
/**
|
|
2
|
+
* @description render element node
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Element as SlateElement } from 'slate';
|
|
6
|
+
import { VNode } from 'snabbdom';
|
|
7
|
+
import { IDomEditor } from '../../editor/interface';
|
|
8
|
+
declare function renderElement(elemNode: SlateElement, editor: IDomEditor): VNode;
|
|
9
|
+
export default renderElement;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 添加文本相关的样式
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Element as SlateElement } from 'slate';
|
|
6
|
-
import { VNode } from 'snabbdom';
|
|
7
|
-
/**
|
|
8
|
-
* 渲染样式
|
|
9
|
-
* @param elem slate elem node
|
|
10
|
-
* @param vnode elem Vnode
|
|
11
|
-
*/
|
|
12
|
-
declare function renderStyle(elem: SlateElement, vnode: VNode): VNode;
|
|
13
|
-
export default renderStyle;
|
|
1
|
+
/**
|
|
2
|
+
* @description 添加文本相关的样式
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Element as SlateElement } from 'slate';
|
|
6
|
+
import { VNode } from 'snabbdom';
|
|
7
|
+
/**
|
|
8
|
+
* 渲染样式
|
|
9
|
+
* @param elem slate elem node
|
|
10
|
+
* @param vnode elem Vnode
|
|
11
|
+
*/
|
|
12
|
+
declare function renderStyle(elem: SlateElement, vnode: VNode): VNode;
|
|
13
|
+
export default renderStyle;
|