@wangeditor-next/editor 5.7.2 → 5.7.4
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/locale/en.d.ts +1 -0
- package/dist/basic-modules/src/locale/zh-CN.d.ts +1 -0
- package/dist/basic-modules/src/modules/format-painter/menu/FormatPainter.d.ts +15 -0
- package/dist/basic-modules/src/modules/image/menu/PreviewImage.d.ts +14 -0
- package/dist/basic-modules/src/modules/image/menu/index.d.ts +5 -0
- package/dist/core/src/config/interface.d.ts +11 -3
- package/dist/core/src/menus/bar/Toolbar.d.ts +2 -0
- package/dist/core/src/utils/vdom.d.ts +6 -6
- package/dist/core.js +1 -1
- package/dist/core.js.map +1 -1
- package/dist/core.mjs +2 -2
- package/dist/core.mjs.map +1 -1
- package/dist/css/style.css +1 -1
- 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/dist/list-module/src/locale/en.d.ts +1 -0
- package/dist/list-module/src/locale/zh-CN.d.ts +1 -0
- package/dist/list-module/src/module/custom-types.d.ts +3 -0
- package/dist/list-module/src/module/helpers.d.ts +4 -1
- package/dist/list-module/src/module/menu/BaseMenu.d.ts +2 -0
- package/dist/list-module/src/module/menu/LowerAlphaListMenu.d.ts +13 -0
- package/dist/list-module/src/module/menu/index.d.ts +5 -0
- package/dist/list-module/src/module/parse-elem-html.d.ts +1 -1
- package/package.json +8 -8
|
@@ -4,9 +4,17 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { IButtonMenu, IDomEditor } from '@wangeditor-next/core';
|
|
6
6
|
import { Text } from 'slate';
|
|
7
|
+
type BlockTypeForFormatPainter = 'header1' | 'header2' | 'header3' | 'header4' | 'header5' | 'header6' | 'blockquote' | 'list-item' | 'todo';
|
|
8
|
+
type OrderedListTypeForFormatPainter = '1' | 'a' | 'A' | 'i' | 'I';
|
|
9
|
+
interface BlockStyleForFormatPainter {
|
|
10
|
+
type: BlockTypeForFormatPainter;
|
|
11
|
+
ordered?: boolean;
|
|
12
|
+
orderType?: OrderedListTypeForFormatPainter;
|
|
13
|
+
}
|
|
7
14
|
interface FormatPaintAttributes {
|
|
8
15
|
isSelect: boolean;
|
|
9
16
|
formatStyle: Omit<Text, 'text'> | null;
|
|
17
|
+
formatBlockStyle: BlockStyleForFormatPainter | null;
|
|
10
18
|
}
|
|
11
19
|
declare class FormatPainter implements IButtonMenu {
|
|
12
20
|
title: string;
|
|
@@ -16,6 +24,13 @@ declare class FormatPainter implements IButtonMenu {
|
|
|
16
24
|
getValue(_editor: IDomEditor): string | boolean;
|
|
17
25
|
isActive(_editor: IDomEditor): boolean;
|
|
18
26
|
isDisabled(_editor: IDomEditor): boolean;
|
|
27
|
+
private isSourceBlockType;
|
|
28
|
+
private isTargetBlockType;
|
|
29
|
+
private getTopLevelSelectedBlocks;
|
|
30
|
+
private normalizeListOrderType;
|
|
31
|
+
private getSelectedBlockStyle;
|
|
32
|
+
private unsetListAttrs;
|
|
33
|
+
private applyBlockStyle;
|
|
19
34
|
setFormatHtml(editor: IDomEditor): void;
|
|
20
35
|
exec(editor: IDomEditor): void;
|
|
21
36
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description preview image menu
|
|
3
|
+
*/
|
|
4
|
+
import { IButtonMenu, IDomEditor } from '@wangeditor-next/core';
|
|
5
|
+
declare class PreviewImage implements IButtonMenu {
|
|
6
|
+
readonly title: string;
|
|
7
|
+
readonly iconSvg = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M924.402464 1023.068211H0.679665V99.345412h461.861399v98.909208H99.596867v725.896389h725.896389V561.206811h98.909208z\" p-id=\"10909\"></path><path d=\"M930.805104 22.977336l69.965436 69.965436-453.492405 453.492404-69.965435-69.901489z\" p-id=\"10910\"></path><path d=\"M1022.464381 304.030081h-98.917201V99.345412H709.230573V0.428211h313.233808z\"></path></svg>";
|
|
8
|
+
readonly tag = "button";
|
|
9
|
+
getValue(editor: IDomEditor): string | boolean;
|
|
10
|
+
isActive(_editor: IDomEditor): boolean;
|
|
11
|
+
isDisabled(editor: IDomEditor): boolean;
|
|
12
|
+
exec(editor: IDomEditor, value: string | boolean): void;
|
|
13
|
+
}
|
|
14
|
+
export default PreviewImage;
|
|
@@ -6,6 +6,7 @@ import DeleteImage from './DeleteImage';
|
|
|
6
6
|
import EditImage from './EditImage';
|
|
7
7
|
import EditorImageSizeMenu from './EditImageSizeMenu';
|
|
8
8
|
import InsertImage from './InsertImage';
|
|
9
|
+
import PreviewImage from './PreviewImage';
|
|
9
10
|
import ViewImageLink from './ViewImageLink';
|
|
10
11
|
import ImageWidth30 from './Width30';
|
|
11
12
|
import ImageWidth50 from './Width50';
|
|
@@ -38,6 +39,10 @@ export declare const viewImageLinkMenuConf: {
|
|
|
38
39
|
key: string;
|
|
39
40
|
factory(): ViewImageLink;
|
|
40
41
|
};
|
|
42
|
+
export declare const previewImageMenuConf: {
|
|
43
|
+
key: string;
|
|
44
|
+
factory(): PreviewImage;
|
|
45
|
+
};
|
|
41
46
|
export declare const imageWidth30MenuConf: {
|
|
42
47
|
key: string;
|
|
43
48
|
factory(): ImageWidth30;
|
|
@@ -138,6 +138,7 @@ export interface IMenuConfig {
|
|
|
138
138
|
insertImage: IInsertImageConfig;
|
|
139
139
|
deleteImage: ISingleMenuConfig;
|
|
140
140
|
editImage: IEditImageConfig;
|
|
141
|
+
previewImage: ISingleMenuConfig;
|
|
141
142
|
viewImageLink: ISingleMenuConfig;
|
|
142
143
|
imageWidth30: ISingleMenuConfig;
|
|
143
144
|
imageWidth50: ISingleMenuConfig;
|
|
@@ -166,6 +167,7 @@ export interface IMenuConfig {
|
|
|
166
167
|
enter: ISingleMenuConfig;
|
|
167
168
|
bulletedList: ISingleMenuConfig;
|
|
168
169
|
numberedList: ISingleMenuConfig;
|
|
170
|
+
numberedListLowerAlpha: ISingleMenuConfig;
|
|
169
171
|
insertTable: ISingleMenuConfig;
|
|
170
172
|
deleteTable: ISingleMenuConfig;
|
|
171
173
|
insertTableRow: IInsertTableConfig;
|
|
@@ -247,14 +249,20 @@ export interface IEditorConfig {
|
|
|
247
249
|
}
|
|
248
250
|
export interface IInsertKeysConfig {
|
|
249
251
|
index: number;
|
|
250
|
-
keys: string |
|
|
251
|
-
replaceFn?: (config:
|
|
252
|
+
keys: string | IToolbarMenuKey[];
|
|
253
|
+
replaceFn?: (config: IToolbarMenuKey) => IToolbarMenuKey;
|
|
252
254
|
}
|
|
255
|
+
export interface IToolbarMenuItemConf {
|
|
256
|
+
key: string;
|
|
257
|
+
title?: string;
|
|
258
|
+
iconSvg?: string;
|
|
259
|
+
}
|
|
260
|
+
export type IToolbarMenuKey = string | IMenuGroup | IToolbarMenuItemConf;
|
|
253
261
|
/**
|
|
254
262
|
* toolbar config
|
|
255
263
|
*/
|
|
256
264
|
export interface IToolbarConfig {
|
|
257
|
-
toolbarKeys:
|
|
265
|
+
toolbarKeys: IToolbarMenuKey[];
|
|
258
266
|
insertKeys: IInsertKeysConfig | Array<IInsertKeysConfig>;
|
|
259
267
|
excludeKeys: Array<string>;
|
|
260
268
|
modalAppendToBody: boolean;
|
|
@@ -20,6 +20,8 @@ declare class Toolbar {
|
|
|
20
20
|
getConfig(): Partial<IToolbarConfig>;
|
|
21
21
|
private initToolbar;
|
|
22
22
|
private registerItems;
|
|
23
|
+
private isMenuGroup;
|
|
24
|
+
private registerSingleMenuByConf;
|
|
23
25
|
private registerGroup;
|
|
24
26
|
private registerSingleItem;
|
|
25
27
|
private getEditorInstance;
|
|
@@ -2,18 +2,13 @@
|
|
|
2
2
|
* @description vdom 相关方法
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { Dataset, Props, VNode, VNodeStyle } from 'snabbdom';
|
|
6
6
|
export type PatchFn = (oldVnode: VNode | Element, vnode: VNode) => VNode;
|
|
7
7
|
/**
|
|
8
8
|
* 创建 snabbdom patch
|
|
9
9
|
* @returns snabbdom patch 函数
|
|
10
10
|
*/
|
|
11
11
|
export declare function genPatchFn(): PatchFn;
|
|
12
|
-
/**
|
|
13
|
-
* 整理 vnode.data ,将暴露出来的零散属性(如 id className data-xxx)放在 data.props 或 data.dataset
|
|
14
|
-
* @param vnode vnode
|
|
15
|
-
*/
|
|
16
|
-
export declare function normalizeVnodeData(vnode: VNode): void;
|
|
17
12
|
/**
|
|
18
13
|
* 给 vnode 添加 prop
|
|
19
14
|
* @param vnode vnode
|
|
@@ -32,3 +27,8 @@ export declare function addVnodeDataset(vnode: VNode, newDataset: Dataset): void
|
|
|
32
27
|
* @param newStyle { key: val }
|
|
33
28
|
*/
|
|
34
29
|
export declare function addVnodeStyle(vnode: VNode, newStyle: VNodeStyle): void;
|
|
30
|
+
/**
|
|
31
|
+
* 整理 vnode.data ,将暴露出来的零散属性(如 id className data-xxx)放在 data.props 或 data.dataset
|
|
32
|
+
* @param vnode vnode
|
|
33
|
+
*/
|
|
34
|
+
export declare function normalizeVnodeData(vnode: VNode): void;
|