@wangeditor-next/core 1.7.6 → 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
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description formats helper
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
export declare function genElemId(id: string): string;
|
|
6
|
-
export declare function genTextId(id: string): string;
|
|
1
|
+
/**
|
|
2
|
+
* @description formats helper
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
export declare function genElemId(id: string): string;
|
|
6
|
+
export declare function genTextId(id: string): string;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description formats entry
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Element as SlateElement, Descendant } from 'slate';
|
|
6
|
-
import { VNode } from 'snabbdom';
|
|
7
|
-
import { IDomEditor } from '../editor/interface';
|
|
8
|
-
export type RenderStyleFnType = (node: Descendant, vnode: VNode) => VNode;
|
|
9
|
-
export declare const RENDER_STYLE_HANDLER_LIST: RenderStyleFnType[];
|
|
10
|
-
/**
|
|
11
|
-
* 注册处理文本样式的函数
|
|
12
|
-
* @param fn 处理文本样式的函数
|
|
13
|
-
*/
|
|
14
|
-
export declare function registerStyleHandler(fn: RenderStyleFnType): void;
|
|
15
|
-
export type RenderElemFnType = (elemNode: SlateElement, children: VNode[] | null, editor: IDomEditor) => VNode;
|
|
16
|
-
export declare const RENDER_ELEM_CONF: {
|
|
17
|
-
[key: string]: RenderElemFnType;
|
|
18
|
-
};
|
|
19
|
-
export interface IRenderElemConf {
|
|
20
|
-
type: string;
|
|
21
|
-
renderElem: RenderElemFnType;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* 注册 render elem 函数
|
|
25
|
-
* @param conf { type, renderElem } ,type 即 node.type
|
|
26
|
-
*/
|
|
27
|
-
export declare function registerRenderElemConf(conf: IRenderElemConf): void;
|
|
1
|
+
/**
|
|
2
|
+
* @description formats entry
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Element as SlateElement, Descendant } from 'slate';
|
|
6
|
+
import { VNode } from 'snabbdom';
|
|
7
|
+
import { IDomEditor } from '../editor/interface';
|
|
8
|
+
export type RenderStyleFnType = (node: Descendant, vnode: VNode) => VNode;
|
|
9
|
+
export declare const RENDER_STYLE_HANDLER_LIST: RenderStyleFnType[];
|
|
10
|
+
/**
|
|
11
|
+
* 注册处理文本样式的函数
|
|
12
|
+
* @param fn 处理文本样式的函数
|
|
13
|
+
*/
|
|
14
|
+
export declare function registerStyleHandler(fn: RenderStyleFnType): void;
|
|
15
|
+
export type RenderElemFnType = (elemNode: SlateElement, children: VNode[] | null, editor: IDomEditor) => VNode;
|
|
16
|
+
export declare const RENDER_ELEM_CONF: {
|
|
17
|
+
[key: string]: RenderElemFnType;
|
|
18
|
+
};
|
|
19
|
+
export interface IRenderElemConf {
|
|
20
|
+
type: string;
|
|
21
|
+
renderElem: RenderElemFnType;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* 注册 render elem 函数
|
|
25
|
+
* @param conf { type, renderElem } ,type 即 node.type
|
|
26
|
+
*/
|
|
27
|
+
export declare function registerRenderElemConf(conf: IRenderElemConf): void;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description slate node to vnode
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Node, Ancestor } from 'slate';
|
|
6
|
-
import { VNode } from 'snabbdom';
|
|
7
|
-
import { IDomEditor } from '../editor/interface';
|
|
8
|
-
/**
|
|
9
|
-
* 根据 slate node 生成 snabbdom vnode
|
|
10
|
-
* @param node node
|
|
11
|
-
* @param index node index in parent.children
|
|
12
|
-
* @param parent parent node
|
|
13
|
-
* @param editor editor
|
|
14
|
-
*/
|
|
15
|
-
export declare function node2Vnode(node: Node, index: number, parent: Ancestor, editor: IDomEditor): VNode;
|
|
1
|
+
/**
|
|
2
|
+
* @description slate node to vnode
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Node, Ancestor } from 'slate';
|
|
6
|
+
import { VNode } from 'snabbdom';
|
|
7
|
+
import { IDomEditor } from '../editor/interface';
|
|
8
|
+
/**
|
|
9
|
+
* 根据 slate node 生成 snabbdom vnode
|
|
10
|
+
* @param node node
|
|
11
|
+
* @param index node index in parent.children
|
|
12
|
+
* @param parent parent node
|
|
13
|
+
* @param editor editor
|
|
14
|
+
*/
|
|
15
|
+
export declare function node2Vnode(node: Node, index: number, parent: Ancestor, editor: IDomEditor): VNode;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 生成 text vnode
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Text as SlateText, Ancestor } from 'slate';
|
|
6
|
-
import { VNode } from 'snabbdom';
|
|
7
|
-
import { IDomEditor } from '../../editor/interface';
|
|
8
|
-
declare function genTextVnode(leafNode: SlateText, isLast: boolean | undefined, textNode: SlateText, parent: Ancestor, editor: IDomEditor): VNode;
|
|
9
|
-
export default genTextVnode;
|
|
1
|
+
/**
|
|
2
|
+
* @description 生成 text vnode
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Text as SlateText, Ancestor } from 'slate';
|
|
6
|
+
import { VNode } from 'snabbdom';
|
|
7
|
+
import { IDomEditor } from '../../editor/interface';
|
|
8
|
+
declare function genTextVnode(leafNode: SlateText, isLast: boolean | undefined, textNode: SlateText, parent: Ancestor, editor: IDomEditor): VNode;
|
|
9
|
+
export default genTextVnode;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description text 样式
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Text as SlateText } from 'slate';
|
|
6
|
-
import { VNode } from 'snabbdom';
|
|
7
|
-
/**
|
|
8
|
-
* 给字符串增加样式
|
|
9
|
-
* @param leafNode slate text leaf node
|
|
10
|
-
* @param textVnode textVnode
|
|
11
|
-
*/
|
|
12
|
-
declare function addTextVnodeStyle(leafNode: SlateText, textVnode: VNode): VNode;
|
|
13
|
-
export default addTextVnodeStyle;
|
|
1
|
+
/**
|
|
2
|
+
* @description text 样式
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Text as SlateText } from 'slate';
|
|
6
|
+
import { VNode } from 'snabbdom';
|
|
7
|
+
/**
|
|
8
|
+
* 给字符串增加样式
|
|
9
|
+
* @param leafNode slate text leaf node
|
|
10
|
+
* @param textVnode textVnode
|
|
11
|
+
*/
|
|
12
|
+
declare function addTextVnodeStyle(leafNode: SlateText, textVnode: VNode): VNode;
|
|
13
|
+
export default addTextVnodeStyle;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description render text node
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Text as SlateText, Ancestor } from 'slate';
|
|
6
|
-
import { VNode } from 'snabbdom';
|
|
7
|
-
import { IDomEditor } from '../../editor/interface';
|
|
8
|
-
declare function renderText(textNode: SlateText, parent: Ancestor, editor: IDomEditor): VNode;
|
|
9
|
-
export default renderText;
|
|
1
|
+
/**
|
|
2
|
+
* @description render text node
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Text as SlateText, Ancestor } from 'slate';
|
|
6
|
+
import { VNode } from 'snabbdom';
|
|
7
|
+
import { IDomEditor } from '../../editor/interface';
|
|
8
|
+
declare function renderText(textNode: SlateText, parent: Ancestor, editor: IDomEditor): VNode;
|
|
9
|
+
export default renderText;
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description text-area class
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Dom7Array, DOMElement } from '../utils/dom';
|
|
6
|
-
declare class TextArea {
|
|
7
|
-
readonly id: number;
|
|
8
|
-
$box: Dom7Array;
|
|
9
|
-
$textAreaContainer: Dom7Array;
|
|
10
|
-
$scroll: Dom7Array;
|
|
11
|
-
$textArea: Dom7Array | null;
|
|
12
|
-
private readonly $progressBar;
|
|
13
|
-
private readonly $maxLengthInfo;
|
|
14
|
-
isComposing: boolean;
|
|
15
|
-
isUpdatingSelection: boolean;
|
|
16
|
-
isDraggingInternally: boolean;
|
|
17
|
-
latestElement: DOMElement | null;
|
|
18
|
-
showPlaceholder: boolean;
|
|
19
|
-
$placeholder: Dom7Array | null;
|
|
20
|
-
private latestEditorSelection;
|
|
21
|
-
constructor(boxSelector: string | DOMElement);
|
|
22
|
-
private get editorInstance();
|
|
23
|
-
private onDOMSelectionChange;
|
|
24
|
-
/**
|
|
25
|
-
* 绑定事件,如 beforeinput onblur onfocus keydown click copy/paste drag/drop 等
|
|
26
|
-
*/
|
|
27
|
-
private bindEvent;
|
|
28
|
-
private onFocusAndOnBlur;
|
|
29
|
-
/**
|
|
30
|
-
* 修改 maxLength 提示信息
|
|
31
|
-
*/
|
|
32
|
-
private changeMaxLengthInfo;
|
|
33
|
-
/**
|
|
34
|
-
* 修改进度条
|
|
35
|
-
* @param progress 进度
|
|
36
|
-
*/
|
|
37
|
-
changeProgress(progress: number): void;
|
|
38
|
-
/**
|
|
39
|
-
* 修改 view 状态
|
|
40
|
-
*/
|
|
41
|
-
changeViewState(): void;
|
|
42
|
-
/**
|
|
43
|
-
* 销毁 textarea
|
|
44
|
-
*/
|
|
45
|
-
destroy(): void;
|
|
46
|
-
}
|
|
47
|
-
export default TextArea;
|
|
1
|
+
/**
|
|
2
|
+
* @description text-area class
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Dom7Array, DOMElement } from '../utils/dom';
|
|
6
|
+
declare class TextArea {
|
|
7
|
+
readonly id: number;
|
|
8
|
+
$box: Dom7Array;
|
|
9
|
+
$textAreaContainer: Dom7Array;
|
|
10
|
+
$scroll: Dom7Array;
|
|
11
|
+
$textArea: Dom7Array | null;
|
|
12
|
+
private readonly $progressBar;
|
|
13
|
+
private readonly $maxLengthInfo;
|
|
14
|
+
isComposing: boolean;
|
|
15
|
+
isUpdatingSelection: boolean;
|
|
16
|
+
isDraggingInternally: boolean;
|
|
17
|
+
latestElement: DOMElement | null;
|
|
18
|
+
showPlaceholder: boolean;
|
|
19
|
+
$placeholder: Dom7Array | null;
|
|
20
|
+
private latestEditorSelection;
|
|
21
|
+
constructor(boxSelector: string | DOMElement);
|
|
22
|
+
private get editorInstance();
|
|
23
|
+
private onDOMSelectionChange;
|
|
24
|
+
/**
|
|
25
|
+
* 绑定事件,如 beforeinput onblur onfocus keydown click copy/paste drag/drop 等
|
|
26
|
+
*/
|
|
27
|
+
private bindEvent;
|
|
28
|
+
private onFocusAndOnBlur;
|
|
29
|
+
/**
|
|
30
|
+
* 修改 maxLength 提示信息
|
|
31
|
+
*/
|
|
32
|
+
private changeMaxLengthInfo;
|
|
33
|
+
/**
|
|
34
|
+
* 修改进度条
|
|
35
|
+
* @param progress 进度
|
|
36
|
+
*/
|
|
37
|
+
changeProgress(progress: number): void;
|
|
38
|
+
/**
|
|
39
|
+
* 修改 view 状态
|
|
40
|
+
*/
|
|
41
|
+
changeViewState(): void;
|
|
42
|
+
/**
|
|
43
|
+
* 销毁 textarea
|
|
44
|
+
*/
|
|
45
|
+
destroy(): void;
|
|
46
|
+
}
|
|
47
|
+
export default TextArea;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 处理 beforeInput 事件
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDomEditor } from '../../editor/interface';
|
|
6
|
-
import TextArea from '../TextArea';
|
|
7
|
-
declare function handleBeforeInput(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
-
export default handleBeforeInput;
|
|
1
|
+
/**
|
|
2
|
+
* @description 处理 beforeInput 事件
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor } from '../../editor/interface';
|
|
6
|
+
import TextArea from '../TextArea';
|
|
7
|
+
declare function handleBeforeInput(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
+
export default handleBeforeInput;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 处理 onblur 事件
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDomEditor } from '../../editor/interface';
|
|
6
|
-
import TextArea from '../TextArea';
|
|
7
|
-
declare function handleOnBlur(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
-
export default handleOnBlur;
|
|
1
|
+
/**
|
|
2
|
+
* @description 处理 onblur 事件
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor } from '../../editor/interface';
|
|
6
|
+
import TextArea from '../TextArea';
|
|
7
|
+
declare function handleOnBlur(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
+
export default handleOnBlur;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 处理 click 事件
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDomEditor } from '../../editor/interface';
|
|
6
|
-
import TextArea from '../TextArea';
|
|
7
|
-
declare function handleOnClick(event: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
-
export default handleOnClick;
|
|
1
|
+
/**
|
|
2
|
+
* @description 处理 click 事件
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor } from '../../editor/interface';
|
|
6
|
+
import TextArea from '../TextArea';
|
|
7
|
+
declare function handleOnClick(event: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
+
export default handleOnClick;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 监听 composition 事件
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDomEditor } from '../../editor/interface';
|
|
6
|
-
import TextArea from '../TextArea';
|
|
7
|
-
/**
|
|
8
|
-
* composition start 事件
|
|
9
|
-
* @param e event
|
|
10
|
-
* @param textarea textarea
|
|
11
|
-
* @param editor editor
|
|
12
|
-
*/
|
|
13
|
-
export declare function handleCompositionStart(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
14
|
-
/**
|
|
15
|
-
* composition update 事件
|
|
16
|
-
* @param e event
|
|
17
|
-
* @param textarea textarea
|
|
18
|
-
* @param editor editor
|
|
19
|
-
*/
|
|
20
|
-
export declare function handleCompositionUpdate(event: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
21
|
-
/**
|
|
22
|
-
* composition end 事件
|
|
23
|
-
* @param e event
|
|
24
|
-
* @param textarea textarea
|
|
25
|
-
* @param editor editor
|
|
26
|
-
*/
|
|
27
|
-
export declare function handleCompositionEnd(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
1
|
+
/**
|
|
2
|
+
* @description 监听 composition 事件
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor } from '../../editor/interface';
|
|
6
|
+
import TextArea from '../TextArea';
|
|
7
|
+
/**
|
|
8
|
+
* composition start 事件
|
|
9
|
+
* @param e event
|
|
10
|
+
* @param textarea textarea
|
|
11
|
+
* @param editor editor
|
|
12
|
+
*/
|
|
13
|
+
export declare function handleCompositionStart(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
14
|
+
/**
|
|
15
|
+
* composition update 事件
|
|
16
|
+
* @param e event
|
|
17
|
+
* @param textarea textarea
|
|
18
|
+
* @param editor editor
|
|
19
|
+
*/
|
|
20
|
+
export declare function handleCompositionUpdate(event: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
21
|
+
/**
|
|
22
|
+
* composition end 事件
|
|
23
|
+
* @param e event
|
|
24
|
+
* @param textarea textarea
|
|
25
|
+
* @param editor editor
|
|
26
|
+
*/
|
|
27
|
+
export declare function handleCompositionEnd(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 处理 copy 事件
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDomEditor } from '../../editor/interface';
|
|
6
|
-
import TextArea from '../TextArea';
|
|
7
|
-
declare function handleOnCopy(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
-
export default handleOnCopy;
|
|
1
|
+
/**
|
|
2
|
+
* @description 处理 copy 事件
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor } from '../../editor/interface';
|
|
6
|
+
import TextArea from '../TextArea';
|
|
7
|
+
declare function handleOnCopy(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
+
export default handleOnCopy;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 处理 cut 事件
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDomEditor } from '../../editor/interface';
|
|
6
|
-
import TextArea from '../TextArea';
|
|
7
|
-
declare function handleOnCut(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
-
export default handleOnCut;
|
|
1
|
+
/**
|
|
2
|
+
* @description 处理 cut 事件
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor } from '../../editor/interface';
|
|
6
|
+
import TextArea from '../TextArea';
|
|
7
|
+
declare function handleOnCut(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
+
export default handleOnCut;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 处理 dragover 事件
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDomEditor } from '../../editor/interface';
|
|
6
|
-
import TextArea from '../TextArea';
|
|
7
|
-
export declare function handleOnDragstart(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
-
export declare function handleOnDragover(event: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
9
|
-
export declare function handleOnDragend(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
1
|
+
/**
|
|
2
|
+
* @description 处理 dragover 事件
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor } from '../../editor/interface';
|
|
6
|
+
import TextArea from '../TextArea';
|
|
7
|
+
export declare function handleOnDragstart(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
+
export declare function handleOnDragover(event: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
9
|
+
export declare function handleOnDragend(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 处理 drop 事件
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDomEditor } from '../../editor/interface';
|
|
6
|
-
import TextArea from '../TextArea';
|
|
7
|
-
declare function handleOnDrop(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
-
export default handleOnDrop;
|
|
1
|
+
/**
|
|
2
|
+
* @description 处理 drop 事件
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor } from '../../editor/interface';
|
|
6
|
+
import TextArea from '../TextArea';
|
|
7
|
+
declare function handleOnDrop(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
+
export default handleOnDrop;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 处理 onfocus 事件
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDomEditor } from '../../editor/interface';
|
|
6
|
-
import TextArea from '../TextArea';
|
|
7
|
-
declare function handleOnFocus(event: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
-
export default handleOnFocus;
|
|
1
|
+
/**
|
|
2
|
+
* @description 处理 onfocus 事件
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor } from '../../editor/interface';
|
|
6
|
+
import TextArea from '../TextArea';
|
|
7
|
+
declare function handleOnFocus(event: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
+
export default handleOnFocus;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description textarea event handlers entry
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import handleBeforeInput from './beforeInput';
|
|
6
|
-
import handleOnBlur from './blur';
|
|
7
|
-
import handleOnFocus from './focus';
|
|
8
|
-
import handleOnClick from './click';
|
|
9
|
-
import { handleCompositionStart, handleCompositionEnd, handleCompositionUpdate } from './composition';
|
|
10
|
-
import handleOnKeydown from './keydown';
|
|
11
|
-
import handleKeypress from './keypress';
|
|
12
|
-
import handleOnCopy from './copy';
|
|
13
|
-
import handleOnCut from './cut';
|
|
14
|
-
import handleOnPaste from './paste';
|
|
15
|
-
import { handleOnDragover, handleOnDragstart, handleOnDragend } from './drag';
|
|
16
|
-
import handleOnDrop from './drop';
|
|
17
|
-
declare const eventConf: {
|
|
18
|
-
beforeinput: typeof handleBeforeInput;
|
|
19
|
-
blur: typeof handleOnBlur;
|
|
20
|
-
focus: typeof handleOnFocus;
|
|
21
|
-
click: typeof handleOnClick;
|
|
22
|
-
compositionstart: typeof handleCompositionStart;
|
|
23
|
-
compositionend: typeof handleCompositionEnd;
|
|
24
|
-
compositionupdate: typeof handleCompositionUpdate;
|
|
25
|
-
keydown: typeof handleOnKeydown;
|
|
26
|
-
keypress: typeof handleKeypress;
|
|
27
|
-
copy: typeof handleOnCopy;
|
|
28
|
-
cut: typeof handleOnCut;
|
|
29
|
-
paste: typeof handleOnPaste;
|
|
30
|
-
dragover: typeof handleOnDragover;
|
|
31
|
-
dragstart: typeof handleOnDragstart;
|
|
32
|
-
dragend: typeof handleOnDragend;
|
|
33
|
-
drop: typeof handleOnDrop;
|
|
34
|
-
};
|
|
35
|
-
export default eventConf;
|
|
1
|
+
/**
|
|
2
|
+
* @description textarea event handlers entry
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import handleBeforeInput from './beforeInput';
|
|
6
|
+
import handleOnBlur from './blur';
|
|
7
|
+
import handleOnFocus from './focus';
|
|
8
|
+
import handleOnClick from './click';
|
|
9
|
+
import { handleCompositionStart, handleCompositionEnd, handleCompositionUpdate } from './composition';
|
|
10
|
+
import handleOnKeydown from './keydown';
|
|
11
|
+
import handleKeypress from './keypress';
|
|
12
|
+
import handleOnCopy from './copy';
|
|
13
|
+
import handleOnCut from './cut';
|
|
14
|
+
import handleOnPaste from './paste';
|
|
15
|
+
import { handleOnDragover, handleOnDragstart, handleOnDragend } from './drag';
|
|
16
|
+
import handleOnDrop from './drop';
|
|
17
|
+
declare const eventConf: {
|
|
18
|
+
beforeinput: typeof handleBeforeInput;
|
|
19
|
+
blur: typeof handleOnBlur;
|
|
20
|
+
focus: typeof handleOnFocus;
|
|
21
|
+
click: typeof handleOnClick;
|
|
22
|
+
compositionstart: typeof handleCompositionStart;
|
|
23
|
+
compositionend: typeof handleCompositionEnd;
|
|
24
|
+
compositionupdate: typeof handleCompositionUpdate;
|
|
25
|
+
keydown: typeof handleOnKeydown;
|
|
26
|
+
keypress: typeof handleKeypress;
|
|
27
|
+
copy: typeof handleOnCopy;
|
|
28
|
+
cut: typeof handleOnCut;
|
|
29
|
+
paste: typeof handleOnPaste;
|
|
30
|
+
dragover: typeof handleOnDragover;
|
|
31
|
+
dragstart: typeof handleOnDragstart;
|
|
32
|
+
dragend: typeof handleOnDragend;
|
|
33
|
+
drop: typeof handleOnDrop;
|
|
34
|
+
};
|
|
35
|
+
export default eventConf;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 监听 onKeydown 事件
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDomEditor } from '../../editor/interface';
|
|
6
|
-
import TextArea from '../TextArea';
|
|
7
|
-
declare function handleOnKeydown(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
-
export default handleOnKeydown;
|
|
1
|
+
/**
|
|
2
|
+
* @description 监听 onKeydown 事件
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor } from '../../editor/interface';
|
|
6
|
+
import TextArea from '../TextArea';
|
|
7
|
+
declare function handleOnKeydown(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
+
export default handleOnKeydown;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 监听 keypress 事件
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDomEditor } from '../../editor/interface';
|
|
6
|
-
import TextArea from '../TextArea';
|
|
7
|
-
declare function handleKeypress(event: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
-
export default handleKeypress;
|
|
1
|
+
/**
|
|
2
|
+
* @description 监听 keypress 事件
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor } from '../../editor/interface';
|
|
6
|
+
import TextArea from '../TextArea';
|
|
7
|
+
declare function handleKeypress(event: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
+
export default handleKeypress;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 处理 paste 事件
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDomEditor } from '../../editor/interface';
|
|
6
|
-
import TextArea from '../TextArea';
|
|
7
|
-
declare function handleOnPaste(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
-
export default handleOnPaste;
|
|
1
|
+
/**
|
|
2
|
+
* @description 处理 paste 事件
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor } from '../../editor/interface';
|
|
6
|
+
import TextArea from '../TextArea';
|
|
7
|
+
declare function handleOnPaste(e: Event, textarea: TextArea, editor: IDomEditor): void;
|
|
8
|
+
export default handleOnPaste;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description textarea helper fns
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { DOMRange, DOMNode } from '../utils/dom';
|
|
6
|
-
import { IDomEditor } from '../editor/interface';
|
|
7
|
-
/**
|
|
8
|
-
* Check if two DOM range objects are equal.
|
|
9
|
-
*/
|
|
10
|
-
export declare const isRangeEqual: (a: DOMRange, b: DOMRange) => boolean;
|
|
11
|
-
/**
|
|
12
|
-
* Check if the target is editable and in the editor.
|
|
13
|
-
*/
|
|
14
|
-
export declare function hasEditableTarget(editor: IDomEditor, target: EventTarget | null): target is DOMNode;
|
|
15
|
-
/**
|
|
16
|
-
* Check if the target is inside void and in an non-readonly editor.
|
|
17
|
-
*/
|
|
18
|
-
export declare function isTargetInsideNonReadonlyVoid(editor: IDomEditor, target: EventTarget | null): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Check if the target is in the editor.
|
|
21
|
-
*/
|
|
22
|
-
export declare function hasTarget(editor: IDomEditor, target: EventTarget | null): target is DOMNode;
|
|
23
|
-
/**
|
|
24
|
-
* Check if a DOM event is overrode by a handler.
|
|
25
|
-
*/
|
|
26
|
-
export declare function isDOMEventHandled(event: Event, handler?: (event: Event) => void | boolean): boolean;
|
|
1
|
+
/**
|
|
2
|
+
* @description textarea helper fns
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { DOMRange, DOMNode } from '../utils/dom';
|
|
6
|
+
import { IDomEditor } from '../editor/interface';
|
|
7
|
+
/**
|
|
8
|
+
* Check if two DOM range objects are equal.
|
|
9
|
+
*/
|
|
10
|
+
export declare const isRangeEqual: (a: DOMRange, b: DOMRange) => boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Check if the target is editable and in the editor.
|
|
13
|
+
*/
|
|
14
|
+
export declare function hasEditableTarget(editor: IDomEditor, target: EventTarget | null): target is DOMNode;
|
|
15
|
+
/**
|
|
16
|
+
* Check if the target is inside void and in an non-readonly editor.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isTargetInsideNonReadonlyVoid(editor: IDomEditor, target: EventTarget | null): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Check if the target is in the editor.
|
|
21
|
+
*/
|
|
22
|
+
export declare function hasTarget(editor: IDomEditor, target: EventTarget | null): target is DOMNode;
|
|
23
|
+
/**
|
|
24
|
+
* Check if a DOM event is overrode by a handler.
|
|
25
|
+
*/
|
|
26
|
+
export declare function isDOMEventHandled(event: Event, handler?: (event: Event) => void | boolean): boolean;
|