@wangeditor-next/editor 5.7.2 → 5.7.3

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.
@@ -247,14 +247,20 @@ export interface IEditorConfig {
247
247
  }
248
248
  export interface IInsertKeysConfig {
249
249
  index: number;
250
- keys: string | Array<string | IMenuGroup>;
251
- replaceFn?: (config: string | IMenuGroup) => string | IMenuGroup;
250
+ keys: string | IToolbarMenuKey[];
251
+ replaceFn?: (config: IToolbarMenuKey) => IToolbarMenuKey;
252
252
  }
253
+ export interface IToolbarMenuItemConf {
254
+ key: string;
255
+ title?: string;
256
+ iconSvg?: string;
257
+ }
258
+ export type IToolbarMenuKey = string | IMenuGroup | IToolbarMenuItemConf;
253
259
  /**
254
260
  * toolbar config
255
261
  */
256
262
  export interface IToolbarConfig {
257
- toolbarKeys: Array<string | IMenuGroup>;
263
+ toolbarKeys: IToolbarMenuKey[];
258
264
  insertKeys: IInsertKeysConfig | Array<IInsertKeysConfig>;
259
265
  excludeKeys: Array<string>;
260
266
  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 { VNode, VNodeStyle, Props, Dataset } from 'snabbdom';
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;