@wangeditor-next/editor 5.5.8 → 5.6.1
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/basic-modules/src/modules/link/menu/config.d.ts +1 -1
- package/dist/basic-modules/src/modules/link/menu/index.d.ts +2 -2
- package/dist/core/src/config/interface.d.ts +136 -3
- package/dist/core/src/config/register.d.ts +1 -1
- package/dist/core/src/editor/interface.d.ts +4 -3
- package/dist/core/src/menus/bar/HoverBar.d.ts +1 -1
- package/dist/core/src/menus/helpers/position.d.ts +1 -1
- package/dist/core/src/menus/interface.d.ts +2 -3
- package/dist/core/src/menus/register.d.ts +3 -4
- package/dist/core/src/utils/dom.d.ts +11 -11
- package/dist/css/style.css +1 -1
- package/dist/editor/src/Boot.d.ts +3 -4
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -8
|
@@ -8,7 +8,7 @@ export declare function genLinkMenuConfig(): {
|
|
|
8
8
|
* @param text link text
|
|
9
9
|
* @param url link url
|
|
10
10
|
*/
|
|
11
|
-
checkLink(
|
|
11
|
+
checkLink(_text: string, _url: string): boolean | string | undefined;
|
|
12
12
|
/**
|
|
13
13
|
* parse link url
|
|
14
14
|
* @param url url
|
|
@@ -10,7 +10,7 @@ declare const insertLinkMenuConf: {
|
|
|
10
10
|
key: string;
|
|
11
11
|
factory(): InsertLink;
|
|
12
12
|
config: {
|
|
13
|
-
checkLink(
|
|
13
|
+
checkLink(_text: string, _url: string): boolean | string | undefined;
|
|
14
14
|
parseLinkUrl(url: string): string;
|
|
15
15
|
};
|
|
16
16
|
};
|
|
@@ -18,7 +18,7 @@ declare const editLinkMenuConf: {
|
|
|
18
18
|
key: string;
|
|
19
19
|
factory(): EditLink;
|
|
20
20
|
config: {
|
|
21
|
-
checkLink(
|
|
21
|
+
checkLink(_text: string, _url: string): boolean | string | undefined;
|
|
22
22
|
parseLinkUrl(url: string): string;
|
|
23
23
|
};
|
|
24
24
|
};
|
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
* @description config interface
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { ImageElement } from 'packages/basic-modules/src/modules/image/custom-types';
|
|
6
|
+
import { VideoElement } from 'packages/video-module/src/module/custom-types';
|
|
7
|
+
import { Node, NodeEntry, Range } from 'slate';
|
|
6
8
|
import { IDomEditor } from '../editor/interface';
|
|
7
9
|
import { IMenuGroup } from '../menus/interface';
|
|
10
|
+
import { IUploadConfig } from '../upload';
|
|
8
11
|
interface IHoverbarConf {
|
|
9
12
|
[key: string]: {
|
|
10
13
|
match?: (editor: IDomEditor, n: Node) => boolean;
|
|
@@ -14,9 +17,139 @@ interface IHoverbarConf {
|
|
|
14
17
|
export type AlertType = 'success' | 'info' | 'warning' | 'error';
|
|
15
18
|
export interface ISingleMenuConfig {
|
|
16
19
|
[key: string]: any;
|
|
20
|
+
iconSvg?: string;
|
|
21
|
+
}
|
|
22
|
+
interface IColorConfig {
|
|
23
|
+
colors: string[];
|
|
24
|
+
}
|
|
25
|
+
interface IFontSizeItem {
|
|
26
|
+
name: string;
|
|
27
|
+
value: string;
|
|
28
|
+
}
|
|
29
|
+
interface IFontSizeConfig {
|
|
30
|
+
fontSizeList: (string | IFontSizeItem)[];
|
|
31
|
+
}
|
|
32
|
+
interface IFontFamilyItem {
|
|
33
|
+
name: string;
|
|
34
|
+
value: string;
|
|
35
|
+
}
|
|
36
|
+
interface IFontFamilyConfig {
|
|
37
|
+
fontFamilyList: (string | IFontFamilyItem)[];
|
|
38
|
+
}
|
|
39
|
+
interface ILineHeightConfig {
|
|
40
|
+
lineHeightList: string[];
|
|
41
|
+
}
|
|
42
|
+
interface IImageMenuBaseConfig {
|
|
43
|
+
checkImage?: (src: string, alt: string, url: string) => boolean | undefined | string;
|
|
44
|
+
parseImageSrc?: (src: string) => string;
|
|
45
|
+
}
|
|
46
|
+
interface IInsertImageConfig extends IImageMenuBaseConfig {
|
|
47
|
+
onInsertedImage?: (imageNode: ImageElement | null) => void;
|
|
48
|
+
}
|
|
49
|
+
interface IEditImageConfig extends IImageMenuBaseConfig {
|
|
50
|
+
onUpdatedImage?: (imageNode: ImageElement | null) => void;
|
|
51
|
+
}
|
|
52
|
+
interface IEmotionConfig {
|
|
53
|
+
emotions: string[];
|
|
54
|
+
}
|
|
55
|
+
interface IInsertTableConfig {
|
|
56
|
+
minWidth: number;
|
|
57
|
+
tableHeader: {
|
|
58
|
+
selected: boolean;
|
|
59
|
+
};
|
|
60
|
+
tableFullWidth: {
|
|
61
|
+
selected: boolean;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
interface ILinkConfig {
|
|
65
|
+
checkLink: (text: string, url: string) => string | boolean | undefined;
|
|
66
|
+
parseLinkUrl: (url: string) => string;
|
|
67
|
+
}
|
|
68
|
+
interface IInsertVideoConfig {
|
|
69
|
+
onInsertedVideo: (videoNode: VideoElement) => NodeEntry | Range;
|
|
70
|
+
checkVideo: (src: string, poster: string) => string | boolean | undefined;
|
|
71
|
+
parseVideoSrc: (url: string) => string;
|
|
72
|
+
}
|
|
73
|
+
interface IUploadVideoConfig extends IUploadConfig {
|
|
74
|
+
}
|
|
75
|
+
interface IUploadImageConfig extends IUploadConfig {
|
|
76
|
+
base64LimitSize?: number;
|
|
77
|
+
}
|
|
78
|
+
interface ICodeLangConfig {
|
|
79
|
+
codeLangs: {
|
|
80
|
+
text: string;
|
|
81
|
+
value: string;
|
|
82
|
+
}[];
|
|
17
83
|
}
|
|
18
84
|
export interface IMenuConfig {
|
|
19
|
-
|
|
85
|
+
bold: ISingleMenuConfig;
|
|
86
|
+
underline: ISingleMenuConfig;
|
|
87
|
+
italic: ISingleMenuConfig;
|
|
88
|
+
through: ISingleMenuConfig;
|
|
89
|
+
code: ISingleMenuConfig;
|
|
90
|
+
sub: ISingleMenuConfig;
|
|
91
|
+
sup: ISingleMenuConfig;
|
|
92
|
+
clearStyle: ISingleMenuConfig;
|
|
93
|
+
color: IColorConfig;
|
|
94
|
+
bgColor: IColorConfig;
|
|
95
|
+
fontSize: IFontSizeConfig;
|
|
96
|
+
fontFamily: IFontFamilyConfig;
|
|
97
|
+
indent: ISingleMenuConfig;
|
|
98
|
+
delIndent: ISingleMenuConfig;
|
|
99
|
+
justifyLeft: ISingleMenuConfig;
|
|
100
|
+
justifyRight: ISingleMenuConfig;
|
|
101
|
+
justifyCenter: ISingleMenuConfig;
|
|
102
|
+
justifyJustify: ISingleMenuConfig;
|
|
103
|
+
lineHeight: ILineHeightConfig;
|
|
104
|
+
insertImage: IInsertImageConfig;
|
|
105
|
+
deleteImage: ISingleMenuConfig;
|
|
106
|
+
editImage: IEditImageConfig;
|
|
107
|
+
viewImageLink: ISingleMenuConfig;
|
|
108
|
+
imageWidth30: ISingleMenuConfig;
|
|
109
|
+
imageWidth50: ISingleMenuConfig;
|
|
110
|
+
imageWidth100: ISingleMenuConfig;
|
|
111
|
+
editorImageSizeMenu: ISingleMenuConfig;
|
|
112
|
+
divider: ISingleMenuConfig;
|
|
113
|
+
emotion: IEmotionConfig;
|
|
114
|
+
insertLink: ILinkConfig;
|
|
115
|
+
editLink: ILinkConfig;
|
|
116
|
+
unLink: ISingleMenuConfig;
|
|
117
|
+
viewLink: ISingleMenuConfig;
|
|
118
|
+
codeBlock: ISingleMenuConfig;
|
|
119
|
+
blockquote: ISingleMenuConfig;
|
|
120
|
+
headerSelect: ISingleMenuConfig;
|
|
121
|
+
header1: ISingleMenuConfig;
|
|
122
|
+
header2: ISingleMenuConfig;
|
|
123
|
+
header3: ISingleMenuConfig;
|
|
124
|
+
header4: ISingleMenuConfig;
|
|
125
|
+
header5: ISingleMenuConfig;
|
|
126
|
+
header6: ISingleMenuConfig;
|
|
127
|
+
todo: ISingleMenuConfig;
|
|
128
|
+
formatPainter: ISingleMenuConfig;
|
|
129
|
+
redo: ISingleMenuConfig;
|
|
130
|
+
undo: ISingleMenuConfig;
|
|
131
|
+
fullScreen: ISingleMenuConfig;
|
|
132
|
+
enter: ISingleMenuConfig;
|
|
133
|
+
bulletedList: ISingleMenuConfig;
|
|
134
|
+
numberedList: ISingleMenuConfig;
|
|
135
|
+
insertTable: ISingleMenuConfig;
|
|
136
|
+
deleteTable: ISingleMenuConfig;
|
|
137
|
+
insertTableRow: IInsertTableConfig;
|
|
138
|
+
deleteTableRow: ISingleMenuConfig;
|
|
139
|
+
insertTableCol: ISingleMenuConfig;
|
|
140
|
+
deleteTableCol: ISingleMenuConfig;
|
|
141
|
+
tableHeader: ISingleMenuConfig;
|
|
142
|
+
tableFullWidth: ISingleMenuConfig;
|
|
143
|
+
mergeTableCell: ISingleMenuConfig;
|
|
144
|
+
splitTableCell: ISingleMenuConfig;
|
|
145
|
+
setTableProperty: ISingleMenuConfig;
|
|
146
|
+
setTableCellProperty: ISingleMenuConfig;
|
|
147
|
+
insertVideo: IInsertVideoConfig;
|
|
148
|
+
uploadVideo: IUploadVideoConfig;
|
|
149
|
+
editVideoSize: ISingleMenuConfig;
|
|
150
|
+
editVideoSrc: ISingleMenuConfig;
|
|
151
|
+
uploadImage: IUploadImageConfig;
|
|
152
|
+
codeSelectLang: ICodeLangConfig;
|
|
20
153
|
}
|
|
21
154
|
/**
|
|
22
155
|
* editor config
|
|
@@ -39,7 +172,7 @@ export interface IEditorConfig {
|
|
|
39
172
|
autoFocus: boolean;
|
|
40
173
|
decorate?: (nodeEntry: NodeEntry) => Range[];
|
|
41
174
|
maxLength?: number;
|
|
42
|
-
MENU_CONF?: IMenuConfig
|
|
175
|
+
MENU_CONF?: Partial<IMenuConfig>;
|
|
43
176
|
hoverbarKeys?: IHoverbarConf;
|
|
44
177
|
EXTEND_CONF?: any;
|
|
45
178
|
}
|
|
@@ -2,14 +2,15 @@
|
|
|
2
2
|
* @description editor interface
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { Editor, Location, Node, Ancestor, Element } from 'slate';
|
|
6
5
|
import ee from 'event-emitter';
|
|
7
|
-
import {
|
|
6
|
+
import { Ancestor, Editor, Element, Location, Node } from 'slate';
|
|
7
|
+
import { AlertType, IEditorConfig, IMenuConfig, ISingleMenuConfig } from '../config/interface';
|
|
8
8
|
import { IPositionStyle } from '../menus/interface';
|
|
9
9
|
import { DOMElement } from '../utils/dom';
|
|
10
10
|
export type ElementWithId = Element & {
|
|
11
11
|
id: string;
|
|
12
12
|
};
|
|
13
|
+
export type getMenuConfigReturnType<K> = K extends keyof IMenuConfig ? IMenuConfig[K] : ISingleMenuConfig;
|
|
13
14
|
/**
|
|
14
15
|
* 扩展 slate Editor 接口
|
|
15
16
|
*/
|
|
@@ -17,7 +18,7 @@ export interface IDomEditor extends Editor {
|
|
|
17
18
|
insertData: (data: DataTransfer) => void;
|
|
18
19
|
setFragmentData: (data: Pick<DataTransfer, 'getData' | 'setData'>) => void;
|
|
19
20
|
getConfig: () => IEditorConfig;
|
|
20
|
-
getMenuConfig: (menuKey:
|
|
21
|
+
getMenuConfig: <K extends string>(menuKey: K) => getMenuConfigReturnType<K>;
|
|
21
22
|
getAllMenuKeys: () => string[];
|
|
22
23
|
alert: (info: string, type: AlertType) => void;
|
|
23
24
|
handleTab: () => void;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description hover bar class
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IButtonMenu,
|
|
5
|
+
import { IButtonMenu, IDropPanelMenu, IModalMenu, ISelectMenu } from '../interface';
|
|
6
6
|
type MenuType = IButtonMenu | ISelectMenu | IDropPanelMenu | IModalMenu;
|
|
7
7
|
declare class HoverBar {
|
|
8
8
|
private readonly $elem;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
5
|
import { Node } from 'slate';
|
|
6
|
-
import { Dom7Array } from '../../utils/dom';
|
|
7
6
|
import { IDomEditor } from '../../editor/interface';
|
|
7
|
+
import { Dom7Array } from '../../utils/dom';
|
|
8
8
|
import { IPositionStyle } from '../interface';
|
|
9
9
|
/**
|
|
10
10
|
* 获取 textContainer 尺寸和定位
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
5
|
import { Node } from 'slate';
|
|
6
|
+
import { ISingleMenuConfig } from '../config/interface';
|
|
6
7
|
import { IDomEditor } from '../editor/interface';
|
|
7
8
|
import { DOMElement } from '../utils/dom';
|
|
8
9
|
export interface IMenuGroup {
|
|
@@ -59,8 +60,6 @@ export type MenuFactoryType = () => IButtonMenu | ISelectMenu | IDropPanelMenu |
|
|
|
59
60
|
export interface IRegisterMenuConf {
|
|
60
61
|
key: string;
|
|
61
62
|
factory: MenuFactoryType;
|
|
62
|
-
config?:
|
|
63
|
-
[key: string]: any;
|
|
64
|
-
};
|
|
63
|
+
config?: ISingleMenuConfig;
|
|
65
64
|
}
|
|
66
65
|
export {};
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* @description register menu
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { ISingleMenuConfig } from '../config/interface';
|
|
6
|
+
import { IRegisterMenuConf, MenuFactoryType } from './interface';
|
|
6
7
|
export declare const MENU_ITEM_FACTORIES: {
|
|
7
8
|
[key: string]: MenuFactoryType;
|
|
8
9
|
};
|
|
@@ -11,6 +12,4 @@ export declare const MENU_ITEM_FACTORIES: {
|
|
|
11
12
|
* @param registerMenuConf { key, factory, config } ,各个 menu key 不能重复
|
|
12
13
|
* @param customConfig 自定义 menu config
|
|
13
14
|
*/
|
|
14
|
-
export declare function registerMenu(registerMenuConf: IRegisterMenuConf, customConfig?:
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
}): void;
|
|
15
|
+
export declare function registerMenu(registerMenuConf: IRegisterMenuConf, customConfig?: ISingleMenuConfig): void;
|
|
@@ -3,12 +3,6 @@
|
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
5
|
import $, { Dom7Array } from 'dom7';
|
|
6
|
-
export { Dom7Array } from 'dom7';
|
|
7
|
-
export default $;
|
|
8
|
-
export declare const isDocument: (value: any) => value is Document;
|
|
9
|
-
export declare const isShadowRoot: (value: any) => value is ShadowRoot;
|
|
10
|
-
export declare const isDataTransfer: (value: any) => value is DataTransfer;
|
|
11
|
-
export declare const isHTMLElememt: (value: any) => value is HTMLElement;
|
|
12
6
|
import DOMNode = globalThis.Node;
|
|
13
7
|
import DOMComment = globalThis.Comment;
|
|
14
8
|
import DOMElement = globalThis.Element;
|
|
@@ -16,12 +10,22 @@ import DOMText = globalThis.Text;
|
|
|
16
10
|
import DOMRange = globalThis.Range;
|
|
17
11
|
import DOMSelection = globalThis.Selection;
|
|
18
12
|
import DOMStaticRange = globalThis.StaticRange;
|
|
19
|
-
export {
|
|
13
|
+
export { Dom7Array } from 'dom7';
|
|
14
|
+
export default $;
|
|
15
|
+
export declare const isDocument: (value: any) => value is Document;
|
|
16
|
+
export declare const isShadowRoot: (value: any) => value is ShadowRoot;
|
|
17
|
+
export declare const isDataTransfer: (value: any) => value is DataTransfer;
|
|
18
|
+
export declare const isHTMLElememt: (value: any) => value is HTMLElement;
|
|
19
|
+
export { DOMComment, DOMElement, DOMNode, DOMRange, DOMSelection, DOMStaticRange, DOMText, };
|
|
20
20
|
export type DOMPoint = [Node, number];
|
|
21
21
|
/**
|
|
22
22
|
* Returns the host window of a DOM node
|
|
23
23
|
*/
|
|
24
24
|
export declare const getDefaultView: (value: any) => Window | null;
|
|
25
|
+
/**
|
|
26
|
+
* Check if a value is a DOM node.
|
|
27
|
+
*/
|
|
28
|
+
export declare const isDOMNode: (value: any) => value is DOMNode;
|
|
25
29
|
/**
|
|
26
30
|
* Check if a DOM node is a comment node.
|
|
27
31
|
*/
|
|
@@ -30,10 +34,6 @@ export declare const isDOMComment: (value: any) => value is DOMComment;
|
|
|
30
34
|
* Check if a DOM node is an element node.
|
|
31
35
|
*/
|
|
32
36
|
export declare const isDOMElement: (value: any) => value is DOMElement;
|
|
33
|
-
/**
|
|
34
|
-
* Check if a value is a DOM node.
|
|
35
|
-
*/
|
|
36
|
-
export declare const isDOMNode: (value: any) => value is DOMNode;
|
|
37
37
|
/**
|
|
38
38
|
* Check if a value is a DOM selection.
|
|
39
39
|
*/
|
package/dist/css/style.css
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
.w-e-text-container *,.w-e-toolbar *{box-sizing:border-box;margin:0;outline:none;padding:0}.w-e-text-container blockquote,.w-e-text-container li,.w-e-text-container p,.w-e-text-container td,.w-e-text-container th,.w-e-toolbar *{line-height:1.5}.w-e-text-container{background-color:var(--w-e-textarea-bg-color);color:var(--w-e-textarea-color);height:100%;position:relative}.no-scroll{width:100%}.w-e-text-container .w-e-scroll{height:100%;-webkit-overflow-scrolling:touch}.w-e-text-container [data-slate-editor]{outline:0;white-space:pre-wrap;word-wrap:break-word;border-top:1px solid transparent;min-height:100%;padding:0 10px}.w-e-text-container [data-slate-editor] p{margin:15px 0}.w-e-text-container [data-slate-editor] h1,.w-e-text-container [data-slate-editor] h2,.w-e-text-container [data-slate-editor] h3,.w-e-text-container [data-slate-editor] h4,.w-e-text-container [data-slate-editor] h5{margin:20px 0}.w-e-text-container [data-slate-editor] img{cursor:default;display:inline!important;max-width:100%;min-height:20px;min-width:20px}.w-e-text-container [data-slate-editor] span{text-indent:0}.w-e-text-container [data-slate-editor] [data-selected=true]{box-shadow:0 0 0 2px var(--w-e-textarea-selected-border-color)}.w-e-text-placeholder{font-style:italic;left:10px;top:17px;width:90%}.w-e-max-length-info,.w-e-text-placeholder{color:var(--w-e-textarea-slight-color);pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}.w-e-max-length-info{bottom:.5em;right:1em}.w-e-bar{background-color:var(--w-e-toolbar-bg-color);color:var(--w-e-toolbar-color);font-size:14px;padding:0 5px}.w-e-bar svg{height:14px;width:14px;fill:var(--w-e-toolbar-color)}.w-e-bar-show{display:flex}.w-e-bar-hidden{display:none}.w-e-hover-bar{border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 5px #0000001f;position:absolute}.w-e-toolbar{flex-wrap:wrap;position:relative}.w-e-bar-divider{background-color:var(--w-e-toolbar-border-color);display:inline-flex;height:40px;margin:0 5px;width:1px}.w-e-bar-item{display:flex;height:40px;padding:4px;position:relative;text-align:center}.w-e-bar-item,.w-e-bar-item button{align-items:center;justify-content:center}.w-e-bar-item button{background:transparent;border:none;color:var(--w-e-toolbar-color);cursor:pointer;display:inline-flex;height:32px;overflow:hidden;padding:0 8px;white-space:nowrap}.w-e-bar-item button:hover{background-color:var(--w-e-toolbar-active-bg-color);color:var(--w-e-toolbar-active-color)}.w-e-bar-item button .title{margin-left:5px}.w-e-bar-item .active{background-color:var(--w-e-toolbar-active-bg-color);color:var(--w-e-toolbar-active-color)}.w-e-bar-item .disabled{color:var(--w-e-toolbar-disabled-color);cursor:not-allowed}.w-e-bar-item .disabled svg{fill:var(--w-e-toolbar-disabled-color)}.w-e-bar-item .disabled:hover{background-color:var(--w-e-toolbar-bg-color);color:var(--w-e-toolbar-disabled-color)}.w-e-bar-item .disabled:hover svg{fill:var(--w-e-toolbar-disabled-color)}.w-e-menu-tooltip-v5:before{background-color:var(--w-e-toolbar-active-color);border-radius:5px;color:var(--w-e-toolbar-bg-color);content:attr(data-tooltip);font-size:.75em;opacity:0;padding:5px 10px;position:absolute;text-align:center;top:40px;transition:opacity .6s;visibility:hidden;white-space:pre;z-index:1}.w-e-menu-tooltip-v5:after{border-color:transparent transparent var(--w-e-toolbar-active-color) transparent;border-style:solid;border-width:5px;content:"";opacity:0;position:absolute;top:30px;transition:opacity .6s;visibility:hidden}.w-e-menu-tooltip-v5:hover:after,.w-e-menu-tooltip-v5:hover:before{opacity:1;visibility:visible}.w-e-menu-tooltip-v5.tooltip-right:before{left:100%;top:10px}.w-e-menu-tooltip-v5.tooltip-right:after{border-color:transparent var(--w-e-toolbar-active-color) transparent transparent;left:100%;margin-left:-10px;top:16px}.w-e-bar-item-group .w-e-bar-item-menus-container{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;display:none;left:0;margin-top:40px;position:absolute;top:0;z-index:1}.w-e-bar-item-group:hover .w-e-bar-item-menus-container{display:block}.w-e-select-list{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;left:0;margin-top:40px;max-height:350px;min-width:100px;overflow-y:auto;position:absolute;top:0;z-index:1}.w-e-select-list ul{line-height:1;list-style:none}.w-e-select-list ul .selected{background-color:var(--w-e-toolbar-active-bg-color)}.w-e-select-list ul li{cursor:pointer;padding:7px 0 7px 25px;position:relative;text-align:left;white-space:nowrap}.w-e-select-list ul li:hover{background-color:var(--w-e-toolbar-active-bg-color)}.w-e-select-list ul li svg{left:0;margin-left:5px;margin-top:-7px;position:absolute;top:50%}.w-e-bar-bottom .w-e-select-list{bottom:0;margin-bottom:40px;margin-top:0;top:inherit}.w-e-drop-panel{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;margin-top:40px;min-width:200px;padding:10px;position:absolute;top:0;z-index:1}.w-e-bar-bottom .w-e-drop-panel{bottom:0;margin-bottom:40px;margin-top:0;top:inherit}.w-e-modal{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-toolbar-border-color);border-radius:3px;box-shadow:0 2px 10px #0000001f;color:var(--w-e-toolbar-color);font-size:14px;min-height:40px;min-width:100px;padding:20px 15px 0;position:absolute;text-align:left;z-index:1}.w-e-modal .btn-close{cursor:pointer;line-height:1;padding:5px;position:absolute;right:8px;top:7px}.w-e-modal .btn-close svg{height:10px;width:10px;fill:var(--w-e-toolbar-color)}.w-e-modal .babel-container{display:block;margin-bottom:15px}.w-e-modal .babel-container span{display:block;margin-bottom:10px}.w-e-modal .button-container{margin-bottom:15px}.w-e-modal button{background-color:var(--w-e-modal-button-bg-color);border:1px solid var(--w-e-modal-button-border-color);border-radius:4px;color:var(--w-e-toolbar-color);cursor:pointer;font-weight:400;height:32px;padding:4.5px 15px;text-align:center;touch-action:manipulation;transition:all .3s cubic-bezier(.645,.045,.355,1);-webkit-user-select:none;-moz-user-select:none;user-select:none;white-space:nowrap}.w-e-modal input[type=number],.w-e-modal input[type=text],.w-e-modal textarea{background-color:var(--w-e-toolbar-bg-color);border:1px solid var(--w-e-modal-button-border-color);border-radius:4px;color:var(--w-e-toolbar-color);font-feature-settings:"tnum";font-variant:tabular-nums;padding:4.5px 11px;transition:all .3s;width:100%}.w-e-modal textarea{min-height:60px}body .w-e-modal,body .w-e-modal *{box-sizing:border-box}.w-e-progress-bar{background-color:var(--w-e-textarea-handler-bg-color);height:1px;position:absolute;transition:width .3s;width:0}.w-e-full-screen-container{bottom:0!important;display:flex!important;flex-direction:column!important;height:100%!important;left:0!important;margin:0!important;padding:0!important;position:fixed;right:0!important;top:0!important;width:100%!important}.w-e-full-screen-container [data-w-e-textarea=true]{flex:1!important}
|
|
3
3
|
.w-e-text-container [data-slate-editor] code{background-color:var(--w-e-textarea-slight-bg-color);border-radius:3px;font-family:monospace;padding:3px}.w-e-panel-content-color{list-style:none;text-align:left;width:230px}.w-e-panel-content-color li{border:1px solid var(--w-e-toolbar-bg-color);border-radius:3px 3px;cursor:pointer;display:inline-block;padding:2px}.w-e-panel-content-color li:hover{border-color:var(--w-e-toolbar-color)}.w-e-panel-content-color li .color-block{border:1px solid var(--w-e-toolbar-border-color);border-radius:3px 3px;height:17px;width:17px}.w-e-panel-content-color .active{border-color:var(--w-e-toolbar-color)}.w-e-panel-content-color .clear{line-height:1.5;margin-bottom:5px;width:100%}.w-e-panel-content-color .clear svg{height:16px;margin-bottom:-4px;width:16px}.w-e-text-container [data-slate-editor] blockquote{background-color:var(--w-e-textarea-slight-bg-color);border-left:8px solid var(--w-e-textarea-selected-border-color);display:block;font-size:100%;line-height:1.5;margin:10px 0;padding:10px}.w-e-panel-content-emotion{font-size:20px;list-style:none;text-align:left;width:300px}.w-e-panel-content-emotion li{border-radius:3px 3px;cursor:pointer;display:inline-block;padding:0 5px}.w-e-panel-content-emotion li:hover{background-color:var(--w-e-textarea-slight-bg-color)}.w-e-textarea-divider{border-radius:3px;margin:20px auto;padding:20px}.w-e-textarea-divider hr{background-color:var(--w-e-textarea-border-color);border:0;display:block;height:1px}.w-e-text-container [data-slate-editor] pre>code{background-color:var(--w-e-textarea-slight-bg-color);border:1px solid var(--w-e-textarea-slight-border-color);border-radius:4px 4px;display:block;font-size:14px;padding:10px;text-indent:0}.w-e-text-container [data-slate-editor] .w-e-image-container{display:inline-block;margin:0 3px}.w-e-text-container [data-slate-editor] .w-e-image-container:hover{box-shadow:0 0 0 2px var(--w-e-textarea-selected-border-color)}.w-e-text-container [data-slate-editor] .w-e-selected-image-container{overflow:hidden;position:relative}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .w-e-image-dragger{background-color:var(--w-e-textarea-handler-bg-color);height:7px;position:absolute;width:7px}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .left-top{cursor:nwse-resize;left:0;top:0}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .right-top{cursor:nesw-resize;right:0;top:0}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .left-bottom{bottom:0;cursor:nesw-resize;left:0}.w-e-text-container [data-slate-editor] .w-e-selected-image-container .right-bottom{bottom:0;cursor:nwse-resize;right:0}.w-e-text-container [data-slate-editor] .w-e-selected-image-container:hover{box-shadow:none}.w-e-text-container [contenteditable=false] .w-e-image-container:hover{box-shadow:none}
|
|
4
4
|
|
|
5
|
-
.w-e-text-container [data-slate-editor] .table-container{border:1px dashed var(--w-e-textarea-border-color);border-radius:5px;margin-top:10px;overflow-x:auto;padding:10px;position:relative;width:100%}.w-e-text-container [data-slate-editor] table{border-collapse:collapse;table-layout:fixed}.w-e-text-container [data-slate-editor] table td,.w-e-text-container [data-slate-editor] table th{border:1px solid var(--w-e-textarea-border-color);line-height:1.5;min-width:30px;overflow:hidden;overflow-wrap:break-word;padding:3px 5px;
|
|
5
|
+
.w-e-text-container [data-slate-editor] .table-container{border:1px dashed var(--w-e-textarea-border-color);border-radius:5px;margin-top:10px;overflow-x:auto;padding:10px;position:relative;width:100%}.w-e-text-container [data-slate-editor] table{border-collapse:collapse;table-layout:fixed}.w-e-text-container [data-slate-editor] table td,.w-e-text-container [data-slate-editor] table th{border:1px solid var(--w-e-textarea-border-color);line-height:1.5;min-width:30px;overflow:hidden;overflow-wrap:break-word;padding:3px 5px;white-space:pre-wrap;word-break:break-all}.w-e-text-container [data-slate-editor] table th{background-color:var(--w-e-textarea-slight-bg-color);font-weight:700;text-align:center}.w-e-text-container [data-slate-editor] table td.w-e-selected,.w-e-text-container [data-slate-editor] table th.w-e-selected{background-color:rgba(20,86,240,.18)}.w-e-text-container [data-slate-editor] table.table-selection-none ::-moz-selection{background:none}.w-e-text-container [data-slate-editor] table.table-selection-none ::selection{background:none}.w-e-text-container [data-slate-editor] .column-resizer{display:flex;height:0;left:11px;position:absolute;top:10px;width:0;z-index:1}.w-e-text-container [data-slate-editor] .column-resizer .column-resizer-item{position:relative}.w-e-text-container [data-slate-editor] .resizer-line-hotzone{cursor:col-resize;opacity:0;position:absolute;right:-3px;transition:opacity .2s ease,visibility .2s ease;visibility:hidden;width:10px}.w-e-text-container [data-slate-editor] .resizer-line-hotzone .resizer-line{background:rgba(20,86,240,.8);height:100%;margin-left:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:2px}.w-e-text-container [data-slate-editor] .resizer-line-hotzone.visible{visibility:visible}.w-e-text-container [data-slate-editor] .resizer-line-hotzone.highlight{opacity:1}.w-e-panel-content-table{background-color:var(--w-e-toolbar-bg-color)}.w-e-panel-content-table table{border-collapse:collapse;table-layout:fixed}.w-e-panel-content-table td,.w-e-panel-content-table th{overflow:hidden;overflow-wrap:break-word;white-space:pre-wrap;word-break:break-all}.w-e-panel-content-table td{border:1px solid var(--w-e-toolbar-border-color);cursor:pointer;height:15px;padding:3px 5px;width:20px}.w-e-panel-content-table td.active{background-color:var(--w-e-toolbar-active-bg-color)}.w-e-modal .babel-container span.babel-container-border{display:flex}.w-e-modal .babel-container span.babel-container-border>*{border:1px solid var(--w-e-modal-button-border-color);border-radius:2px;height:28px}.w-e-modal .babel-container span.babel-container-border select{width:114px}.w-e-modal .babel-container span.babel-container-border>:nth-child(n+2){margin-left:8px}.w-e-modal .babel-container span.babel-container-border input:nth-child(3){width:100px}.w-e-modal .babel-container span.babel-container-background input{width:60px}.w-e-modal .babel-container .color-group,.w-e-modal .babel-container span.babel-container-algin select,.w-e-modal .babel-container span.babel-container-background input{border:1px solid var(--w-e-modal-button-border-color);border-radius:2px;height:28px}.w-e-modal .babel-container .color-group{cursor:pointer;position:relative;width:28px}.w-e-modal .babel-container .color-group .w-e-drop-panel{margin-top:28px}.w-e-modal .babel-container .color-group-block{display:block;height:80%;margin:10%;width:80%}.w-e-modal .babel-container .color-group-block svg{height:20px;margin:1px 0;width:20px}
|
|
6
6
|
.w-e-textarea-video-container{background-image:linear-gradient(45deg,#eee 25%,transparent 0,transparent 75%,#eee 0,#eee),linear-gradient(45deg,#eee 25%,#fff 0,#fff 75%,#eee 0,#eee);background-position:0 0,10px 10px;background-size:20px 20px;border:1px dashed var(--w-e-textarea-border-color);border-radius:5px;margin:10px auto 0;padding:10px 0;text-align:center}
|
|
7
7
|
|
|
8
8
|
.w-e-text-container [data-slate-editor] pre>code{font-family:Consolas,Monaco,Andale Mono,Ubuntu Mono,monospace;text-align:left;text-shadow:0 1px #fff;white-space:pre;word-break:normal;word-spacing:normal;word-wrap:normal;-webkit-hyphens:none;hyphens:none;line-height:1.5;margin:.5em 0;overflow:auto;padding:1em;-moz-tab-size:4;-o-tab-size:4;tab-size:4}.w-e-text-container [data-slate-editor] pre>code .token.cdata,.w-e-text-container [data-slate-editor] pre>code .token.comment,.w-e-text-container [data-slate-editor] pre>code .token.doctype,.w-e-text-container [data-slate-editor] pre>code .token.prolog{color:#708090}.w-e-text-container [data-slate-editor] pre>code .token.punctuation{color:#999}.w-e-text-container [data-slate-editor] pre>code .token.namespace{opacity:.7}.w-e-text-container [data-slate-editor] pre>code .token.boolean,.w-e-text-container [data-slate-editor] pre>code .token.constant,.w-e-text-container [data-slate-editor] pre>code .token.deleted,.w-e-text-container [data-slate-editor] pre>code .token.number,.w-e-text-container [data-slate-editor] pre>code .token.property,.w-e-text-container [data-slate-editor] pre>code .token.symbol,.w-e-text-container [data-slate-editor] pre>code .token.tag{color:#905}.w-e-text-container [data-slate-editor] pre>code .token.attr-name,.w-e-text-container [data-slate-editor] pre>code .token.builtin,.w-e-text-container [data-slate-editor] pre>code .token.char,.w-e-text-container [data-slate-editor] pre>code .token.inserted,.w-e-text-container [data-slate-editor] pre>code .token.selector,.w-e-text-container [data-slate-editor] pre>code .token.string{color:#690}.w-e-text-container [data-slate-editor] pre>code .language-css .token.string,.w-e-text-container [data-slate-editor] pre>code .style .token.string,.w-e-text-container [data-slate-editor] pre>code .token.entity,.w-e-text-container [data-slate-editor] pre>code .token.operator,.w-e-text-container [data-slate-editor] pre>code .token.url{color:#9a6e3a}.w-e-text-container [data-slate-editor] pre>code .token.atrule,.w-e-text-container [data-slate-editor] pre>code .token.attr-value,.w-e-text-container [data-slate-editor] pre>code .token.keyword{color:#07a}.w-e-text-container [data-slate-editor] pre>code .token.class-name,.w-e-text-container [data-slate-editor] pre>code .token.function{color:#dd4a68}.w-e-text-container [data-slate-editor] pre>code .token.important,.w-e-text-container [data-slate-editor] pre>code .token.regex,.w-e-text-container [data-slate-editor] pre>code .token.variable{color:#e90}.w-e-text-container [data-slate-editor] pre>code .token.bold,.w-e-text-container [data-slate-editor] pre>code .token.important{font-weight:700}.w-e-text-container [data-slate-editor] pre>code .token.italic{font-style:italic}.w-e-text-container [data-slate-editor] pre>code .token.entity{cursor:help}
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* @description Editor View class
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IDomEditor, IEditorConfig,
|
|
5
|
+
import { IDomEditor, IEditorConfig, IElemToHtmlConf, IModuleConf, IParseElemHtmlConf, IPreParseHtmlConf, IRegisterMenuConf, IRenderElemConf, IToolbarConfig, ParseStyleHtmlFnType, RenderStyleFnType, styleToHtmlFnType } from '@wangeditor-next/core';
|
|
6
|
+
import { ISingleMenuConfig } from 'packages/core/src/config/interface';
|
|
6
7
|
type PluginType = <T extends IDomEditor>(editor: T) => T;
|
|
7
8
|
declare class Boot {
|
|
8
9
|
constructor();
|
|
@@ -16,9 +17,7 @@ declare class Boot {
|
|
|
16
17
|
static setSimpleToolbarConfig(newConfig?: Partial<IToolbarConfig>): void;
|
|
17
18
|
static plugins: PluginType[];
|
|
18
19
|
static registerPlugin(plugin: PluginType): void;
|
|
19
|
-
static registerMenu(menuConf: IRegisterMenuConf, customConfig?:
|
|
20
|
-
[key: string]: any;
|
|
21
|
-
}): void;
|
|
20
|
+
static registerMenu(menuConf: IRegisterMenuConf, customConfig?: ISingleMenuConfig): void;
|
|
22
21
|
static registerRenderElem(renderElemConf: IRenderElemConf): void;
|
|
23
22
|
static registerRenderStyle(fn: RenderStyleFnType): void;
|
|
24
23
|
static registerElemToHtml(elemToHtmlConf: IElemToHtmlConf): void;
|