@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,13 +1,13 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description editor config
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IEditorConfig, IToolbarConfig } from './interface';
|
|
6
|
-
/**
|
|
7
|
-
* 生成编辑器默认配置
|
|
8
|
-
*/
|
|
9
|
-
export declare function genEditorConfig(userConfig?: Partial<IEditorConfig>): IEditorConfig;
|
|
10
|
-
/**
|
|
11
|
-
* 生成 toolbar 默认配置
|
|
12
|
-
*/
|
|
13
|
-
export declare function genToolbarConfig(userConfig?: Partial<IToolbarConfig>): IToolbarConfig;
|
|
1
|
+
/**
|
|
2
|
+
* @description editor config
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IEditorConfig, IToolbarConfig } from './interface';
|
|
6
|
+
/**
|
|
7
|
+
* 生成编辑器默认配置
|
|
8
|
+
*/
|
|
9
|
+
export declare function genEditorConfig(userConfig?: Partial<IEditorConfig>): IEditorConfig;
|
|
10
|
+
/**
|
|
11
|
+
* 生成 toolbar 默认配置
|
|
12
|
+
*/
|
|
13
|
+
export declare function genToolbarConfig(userConfig?: Partial<IToolbarConfig>): IToolbarConfig;
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description config interface
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Range, NodeEntry, Node } from 'slate';
|
|
6
|
-
import { IDomEditor } from '../editor/interface';
|
|
7
|
-
import { IMenuGroup } from '../menus/interface';
|
|
8
|
-
interface IHoverbarConf {
|
|
9
|
-
[key: string]: {
|
|
10
|
-
match?: (editor: IDomEditor, n: Node) => boolean;
|
|
11
|
-
menuKeys: string[];
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
export type AlertType = 'success' | 'info' | 'warning' | 'error';
|
|
15
|
-
export interface ISingleMenuConfig {
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}
|
|
18
|
-
export interface IMenuConfig {
|
|
19
|
-
[key: string]: ISingleMenuConfig;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* editor config
|
|
23
|
-
*/
|
|
24
|
-
export interface IEditorConfig {
|
|
25
|
-
customAlert: (info: string, type: AlertType) => void;
|
|
26
|
-
onCreated?: (editor: IDomEditor) => void;
|
|
27
|
-
onChange?: (editor: IDomEditor) => void;
|
|
28
|
-
onDestroyed?: (editor: IDomEditor) => void;
|
|
29
|
-
onMaxLength?: (editor: IDomEditor) => void;
|
|
30
|
-
onFocus?: (editor: IDomEditor) => void;
|
|
31
|
-
onBlur?: (editor: IDomEditor) => void;
|
|
32
|
-
/**
|
|
33
|
-
* 自定义粘贴。返回 true 则继续粘贴,返回 false 则自行实现粘贴,阻止默认粘贴
|
|
34
|
-
*/
|
|
35
|
-
customPaste?: (editor: IDomEditor, e: ClipboardEvent) => boolean;
|
|
36
|
-
scroll: boolean;
|
|
37
|
-
placeholder?: string;
|
|
38
|
-
readOnly: boolean;
|
|
39
|
-
autoFocus: boolean;
|
|
40
|
-
decorate?: (nodeEntry: NodeEntry) => Range[];
|
|
41
|
-
maxLength?: number;
|
|
42
|
-
MENU_CONF?: IMenuConfig;
|
|
43
|
-
hoverbarKeys?: IHoverbarConf;
|
|
44
|
-
EXTEND_CONF?: any;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* toolbar config
|
|
48
|
-
*/
|
|
49
|
-
export interface IToolbarConfig {
|
|
50
|
-
toolbarKeys: Array<string | IMenuGroup>;
|
|
51
|
-
insertKeys: {
|
|
52
|
-
index: number;
|
|
53
|
-
keys: string | Array<string | IMenuGroup>;
|
|
54
|
-
};
|
|
55
|
-
excludeKeys: Array<string>;
|
|
56
|
-
modalAppendToBody: boolean;
|
|
57
|
-
}
|
|
58
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @description config interface
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Range, NodeEntry, Node } from 'slate';
|
|
6
|
+
import { IDomEditor } from '../editor/interface';
|
|
7
|
+
import { IMenuGroup } from '../menus/interface';
|
|
8
|
+
interface IHoverbarConf {
|
|
9
|
+
[key: string]: {
|
|
10
|
+
match?: (editor: IDomEditor, n: Node) => boolean;
|
|
11
|
+
menuKeys: string[];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export type AlertType = 'success' | 'info' | 'warning' | 'error';
|
|
15
|
+
export interface ISingleMenuConfig {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}
|
|
18
|
+
export interface IMenuConfig {
|
|
19
|
+
[key: string]: ISingleMenuConfig;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* editor config
|
|
23
|
+
*/
|
|
24
|
+
export interface IEditorConfig {
|
|
25
|
+
customAlert: (info: string, type: AlertType) => void;
|
|
26
|
+
onCreated?: (editor: IDomEditor) => void;
|
|
27
|
+
onChange?: (editor: IDomEditor) => void;
|
|
28
|
+
onDestroyed?: (editor: IDomEditor) => void;
|
|
29
|
+
onMaxLength?: (editor: IDomEditor) => void;
|
|
30
|
+
onFocus?: (editor: IDomEditor) => void;
|
|
31
|
+
onBlur?: (editor: IDomEditor) => void;
|
|
32
|
+
/**
|
|
33
|
+
* 自定义粘贴。返回 true 则继续粘贴,返回 false 则自行实现粘贴,阻止默认粘贴
|
|
34
|
+
*/
|
|
35
|
+
customPaste?: (editor: IDomEditor, e: ClipboardEvent) => boolean;
|
|
36
|
+
scroll: boolean;
|
|
37
|
+
placeholder?: string;
|
|
38
|
+
readOnly: boolean;
|
|
39
|
+
autoFocus: boolean;
|
|
40
|
+
decorate?: (nodeEntry: NodeEntry) => Range[];
|
|
41
|
+
maxLength?: number;
|
|
42
|
+
MENU_CONF?: IMenuConfig;
|
|
43
|
+
hoverbarKeys?: IHoverbarConf;
|
|
44
|
+
EXTEND_CONF?: any;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* toolbar config
|
|
48
|
+
*/
|
|
49
|
+
export interface IToolbarConfig {
|
|
50
|
+
toolbarKeys: Array<string | IMenuGroup>;
|
|
51
|
+
insertKeys: {
|
|
52
|
+
index: number;
|
|
53
|
+
keys: string | Array<string | IMenuGroup>;
|
|
54
|
+
};
|
|
55
|
+
excludeKeys: Array<string>;
|
|
56
|
+
modalAppendToBody: boolean;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description config register
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IMenuConfig, ISingleMenuConfig } from '../config/interface';
|
|
6
|
-
export declare const GLOBAL_MENU_CONF: IMenuConfig;
|
|
7
|
-
/**
|
|
8
|
-
* 注册全局菜单配置
|
|
9
|
-
* @param key menu key
|
|
10
|
-
* @param config config
|
|
11
|
-
*/
|
|
12
|
-
export declare function registerGlobalMenuConf(key: string, config?: ISingleMenuConfig): void;
|
|
1
|
+
/**
|
|
2
|
+
* @description config register
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IMenuConfig, ISingleMenuConfig } from '../config/interface';
|
|
6
|
+
export declare const GLOBAL_MENU_CONF: IMenuConfig;
|
|
7
|
+
/**
|
|
8
|
+
* 注册全局菜单配置
|
|
9
|
+
* @param key menu key
|
|
10
|
+
* @param config config
|
|
11
|
+
*/
|
|
12
|
+
export declare function registerGlobalMenuConf(key: string, config?: ISingleMenuConfig): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const IGNORE_TAGS: Set<string>;
|
|
1
|
+
export declare const IGNORE_TAGS: Set<string>;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description svg tag
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* 【注意】svg 字符串的长度 ,否则会导致代码体积过大
|
|
7
|
-
* 尽量选择 https://www.iconfont.cn/collections/detail?spm=a313x.7781069.0.da5a778a4&cid=20293
|
|
8
|
-
* 找不到再从 iconfont.com 搜索
|
|
9
|
-
*/
|
|
10
|
-
export declare const SVG_CHECK_MARK = "<svg viewBox=\"0 0 1446 1024\"><path d=\"M574.116299 786.736392 1238.811249 48.517862C1272.390222 11.224635 1329.414799 7.827718 1366.75664 41.450462 1403.840015 74.840484 1406.731043 132.084741 1373.10189 169.433699L655.118888 966.834607C653.072421 969.716875 650.835807 972.514337 648.407938 975.210759 615.017957 1012.29409 558.292155 1015.652019 521.195664 982.250188L72.778218 578.493306C35.910826 545.297758 32.859041 488.584019 66.481825 451.242134 99.871807 414.158803 156.597563 410.800834 193.694055 444.202665L574.116299 786.736392Z\"></path></svg>";
|
|
11
|
-
export declare const SVG_DOWN_ARROW = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M498.7 655.8l-197.6-268c-8.1-10.9-0.3-26.4 13.3-26.4h395.2c13.6 0 21.4 15.4 13.3 26.4l-197.6 268c-6.6 9-20 9-26.6 0z\"></path></svg>";
|
|
12
|
-
export declare const SVG_CLOSE = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M1024 896.1024l-128 128L512 640 128 1024 0 896 384 512 0 128 128 0 512 384 896.1024 0l128 128L640 512z\"></path></svg>";
|
|
1
|
+
/**
|
|
2
|
+
* @description svg tag
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 【注意】svg 字符串的长度 ,否则会导致代码体积过大
|
|
7
|
+
* 尽量选择 https://www.iconfont.cn/collections/detail?spm=a313x.7781069.0.da5a778a4&cid=20293
|
|
8
|
+
* 找不到再从 iconfont.com 搜索
|
|
9
|
+
*/
|
|
10
|
+
export declare const SVG_CHECK_MARK = "<svg viewBox=\"0 0 1446 1024\"><path d=\"M574.116299 786.736392 1238.811249 48.517862C1272.390222 11.224635 1329.414799 7.827718 1366.75664 41.450462 1403.840015 74.840484 1406.731043 132.084741 1373.10189 169.433699L655.118888 966.834607C653.072421 969.716875 650.835807 972.514337 648.407938 975.210759 615.017957 1012.29409 558.292155 1015.652019 521.195664 982.250188L72.778218 578.493306C35.910826 545.297758 32.859041 488.584019 66.481825 451.242134 99.871807 414.158803 156.597563 410.800834 193.694055 444.202665L574.116299 786.736392Z\"></path></svg>";
|
|
11
|
+
export declare const SVG_DOWN_ARROW = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M498.7 655.8l-197.6-268c-8.1-10.9-0.3-26.4 13.3-26.4h395.2c13.6 0 21.4 15.4 13.3 26.4l-197.6 268c-6.6 9-20 9-26.6 0z\"></path></svg>";
|
|
12
|
+
export declare const SVG_CLOSE = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M1024 896.1024l-128 128L512 640 128 1024 0 896 384 512 0 128 128 0 512 384 896.1024 0l128 128L640 512z\"></path></svg>";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description 绑定 node 的关系
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Node, Ancestor } from 'slate';
|
|
6
|
-
import { IDomEditor } from '../editor/interface';
|
|
7
|
-
/**
|
|
8
|
-
* createEditor 未传递 selector 时,绑定 node 的关系( NODE_TO_PARENT, NODE_TO_INDEX 等 )
|
|
9
|
-
* @param node node
|
|
10
|
-
* @param index index
|
|
11
|
-
* @param parent parent node
|
|
12
|
-
* @param editor editor
|
|
13
|
-
*/
|
|
14
|
-
declare function bindNodeRelation(node: Node, index: number, parent: Ancestor, editor: IDomEditor): void;
|
|
15
|
-
export default bindNodeRelation;
|
|
1
|
+
/**
|
|
2
|
+
* @description 绑定 node 的关系
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Node, Ancestor } from 'slate';
|
|
6
|
+
import { IDomEditor } from '../editor/interface';
|
|
7
|
+
/**
|
|
8
|
+
* createEditor 未传递 selector 时,绑定 node 的关系( NODE_TO_PARENT, NODE_TO_INDEX 等 )
|
|
9
|
+
* @param node node
|
|
10
|
+
* @param index index
|
|
11
|
+
* @param parent parent node
|
|
12
|
+
* @param editor editor
|
|
13
|
+
*/
|
|
14
|
+
declare function bindNodeRelation(node: Node, index: number, parent: Ancestor, editor: IDomEditor): void;
|
|
15
|
+
export default bindNodeRelation;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description create editor
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Descendant } from 'slate';
|
|
6
|
-
import { IDomEditor } from '../editor/interface';
|
|
7
|
-
import { IEditorConfig } from '../config/interface';
|
|
8
|
-
import type { DOMElement } from '../utils/dom';
|
|
9
|
-
type PluginFnType = <T extends IDomEditor>(editor: T) => T;
|
|
10
|
-
interface ICreateOption {
|
|
11
|
-
selector: string | DOMElement;
|
|
12
|
-
config: Partial<IEditorConfig>;
|
|
13
|
-
content?: Descendant[];
|
|
14
|
-
html?: string;
|
|
15
|
-
plugins: PluginFnType[];
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* 创建编辑器
|
|
19
|
-
*/
|
|
20
|
-
export default function (option: Partial<ICreateOption>): import("slate").BaseEditor & IDomEditor & import("slate-history").HistoryEditor;
|
|
21
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @description create editor
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Descendant } from 'slate';
|
|
6
|
+
import { IDomEditor } from '../editor/interface';
|
|
7
|
+
import { IEditorConfig } from '../config/interface';
|
|
8
|
+
import type { DOMElement } from '../utils/dom';
|
|
9
|
+
type PluginFnType = <T extends IDomEditor>(editor: T) => T;
|
|
10
|
+
interface ICreateOption {
|
|
11
|
+
selector: string | DOMElement;
|
|
12
|
+
config: Partial<IEditorConfig>;
|
|
13
|
+
content?: Descendant[];
|
|
14
|
+
html?: string;
|
|
15
|
+
plugins: PluginFnType[];
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 创建编辑器
|
|
19
|
+
*/
|
|
20
|
+
export default function (option: Partial<ICreateOption>): import("slate").BaseEditor & IDomEditor & import("slate-history").HistoryEditor;
|
|
21
|
+
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description create toolbar
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { IDomEditor } from '../editor/interface';
|
|
6
|
-
import Toolbar from '../menus/bar/Toolbar';
|
|
7
|
-
import { IToolbarConfig } from '../config/interface';
|
|
8
|
-
import { DOMElement } from '../utils/dom';
|
|
9
|
-
interface ICreateOption {
|
|
10
|
-
selector: string | DOMElement;
|
|
11
|
-
config?: Partial<IToolbarConfig>;
|
|
12
|
-
}
|
|
13
|
-
export default function (editor: IDomEditor | null, option: ICreateOption): Toolbar;
|
|
14
|
-
export {};
|
|
1
|
+
/**
|
|
2
|
+
* @description create toolbar
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor } from '../editor/interface';
|
|
6
|
+
import Toolbar from '../menus/bar/Toolbar';
|
|
7
|
+
import { IToolbarConfig } from '../config/interface';
|
|
8
|
+
import { DOMElement } from '../utils/dom';
|
|
9
|
+
interface ICreateOption {
|
|
10
|
+
selector: string | DOMElement;
|
|
11
|
+
config?: Partial<IToolbarConfig>;
|
|
12
|
+
}
|
|
13
|
+
export default function (editor: IDomEditor | null, option: ICreateOption): Toolbar;
|
|
14
|
+
export {};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description create helper
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import { Descendant } from 'slate';
|
|
6
|
-
import { IDomEditor } from '../editor/interface';
|
|
7
|
-
import { DOMElement } from '../utils/dom';
|
|
8
|
-
/**
|
|
9
|
-
* 检查是否重复创建 textarea
|
|
10
|
-
*/
|
|
11
|
-
export declare function isRepeatedCreateTextarea(editor: IDomEditor, selector: string | DOMElement): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* 检查是否重复创建 toolbar
|
|
14
|
-
*/
|
|
15
|
-
export declare function isRepeatedCreateToolbar(editor: IDomEditor, selector: string | DOMElement): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* 生成默认 content
|
|
18
|
-
*/
|
|
19
|
-
export declare function genDefaultContent(): {
|
|
20
|
-
type: string;
|
|
21
|
-
children: {
|
|
22
|
-
text: string;
|
|
23
|
-
}[];
|
|
24
|
-
}[];
|
|
25
|
-
/**
|
|
26
|
-
* html 字符串 -> content
|
|
27
|
-
* @param editor editor
|
|
28
|
-
* @param html html 字符串
|
|
29
|
-
*/
|
|
30
|
-
export declare function htmlToContent(editor: IDomEditor, html?: string): Descendant[];
|
|
1
|
+
/**
|
|
2
|
+
* @description create helper
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { Descendant } from 'slate';
|
|
6
|
+
import { IDomEditor } from '../editor/interface';
|
|
7
|
+
import { DOMElement } from '../utils/dom';
|
|
8
|
+
/**
|
|
9
|
+
* 检查是否重复创建 textarea
|
|
10
|
+
*/
|
|
11
|
+
export declare function isRepeatedCreateTextarea(editor: IDomEditor, selector: string | DOMElement): boolean;
|
|
12
|
+
/**
|
|
13
|
+
* 检查是否重复创建 toolbar
|
|
14
|
+
*/
|
|
15
|
+
export declare function isRepeatedCreateToolbar(editor: IDomEditor, selector: string | DOMElement): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* 生成默认 content
|
|
18
|
+
*/
|
|
19
|
+
export declare function genDefaultContent(): {
|
|
20
|
+
type: string;
|
|
21
|
+
children: {
|
|
22
|
+
text: string;
|
|
23
|
+
}[];
|
|
24
|
+
}[];
|
|
25
|
+
/**
|
|
26
|
+
* html 字符串 -> content
|
|
27
|
+
* @param editor editor
|
|
28
|
+
* @param html html 字符串
|
|
29
|
+
*/
|
|
30
|
+
export declare function htmlToContent(editor: IDomEditor, html?: string): Descendant[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @description create entry
|
|
3
|
-
* @author wangfupeng
|
|
4
|
-
*/
|
|
5
|
-
import coreCreateEditor from './create-editor';
|
|
6
|
-
import coreCreateToolbar from './create-toolbar';
|
|
7
|
-
export { coreCreateEditor, coreCreateToolbar };
|
|
1
|
+
/**
|
|
2
|
+
* @description create entry
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import coreCreateEditor from './create-editor';
|
|
6
|
+
import coreCreateToolbar from './create-toolbar';
|
|
7
|
+
export { coreCreateEditor, coreCreateToolbar };
|