@wangeditor-next/editor 6.0.2 → 6.1.0
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/header/parse-elem-html.d.ts +2 -2
- package/dist/core/src/index.d.ts +3 -1
- package/dist/core/src/to-html/index.d.ts +12 -0
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css/style.css +1 -1
- package/dist/editor/src/Boot.d.ts +2 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +3 -3
- package/dist/list-module/src/locale/en.d.ts +3 -0
- package/dist/list-module/src/locale/zh-CN.d.ts +3 -0
- package/dist/list-module/src/module/custom-types.d.ts +13 -0
- package/dist/list-module/src/module/helpers.d.ts +14 -4
- package/dist/list-module/src/module/html-transform.d.ts +10 -0
- package/dist/list-module/src/module/menu/BaseMenu.d.ts +2 -2
- package/dist/list-module/src/module/outline-actions.d.ts +9 -0
- package/dist/list-module/src/module/parse-elem-html.d.ts +1 -2
- package/dist/list-module/src/module/plugin.d.ts +1 -1
- package/package.json +5 -5
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { IDomEditor } from '@wangeditor-next/core';
|
|
6
6
|
import { Descendant } from 'slate';
|
|
7
7
|
import { DOMElement } from '../../utils/dom';
|
|
8
|
-
import { Header1Element, Header2Element, Header3Element, Header4Element, Header5Element } from './custom-types';
|
|
8
|
+
import { Header1Element, Header2Element, Header3Element, Header4Element, Header5Element, Header6Element } from './custom-types';
|
|
9
9
|
export declare const parseHeader1HtmlConf: {
|
|
10
10
|
selector: string;
|
|
11
11
|
parseElemHtml: (elem: DOMElement, children: Descendant[], editor: IDomEditor) => Header1Element;
|
|
@@ -28,5 +28,5 @@ export declare const parseHeader5HtmlConf: {
|
|
|
28
28
|
};
|
|
29
29
|
export declare const parseHeader6HtmlConf: {
|
|
30
30
|
selector: string;
|
|
31
|
-
parseElemHtml: (elem: DOMElement, children: Descendant[], editor: IDomEditor) =>
|
|
31
|
+
parseElemHtml: (elem: DOMElement, children: Descendant[], editor: IDomEditor) => Header6Element;
|
|
32
32
|
};
|
package/dist/core/src/index.d.ts
CHANGED
|
@@ -7,11 +7,12 @@ import type { IDomEditor } from './editor/interface';
|
|
|
7
7
|
import type { IRegisterMenuConf } from './menus/index';
|
|
8
8
|
import type { IParseElemHtmlConf, IPreParseHtmlConf, ParseStyleHtmlFnType } from './parse-html/index';
|
|
9
9
|
import type { IRenderElemConf, RenderStyleFnType } from './render/index';
|
|
10
|
-
import type { IElemToHtmlConf, styleToHtmlFnType } from './to-html/index';
|
|
10
|
+
import type { HtmlTransformFnType, IElemToHtmlConf, styleToHtmlFnType } from './to-html/index';
|
|
11
11
|
import createUploaderRuntime from './upload/createUploader';
|
|
12
12
|
import type { IUploadConfig } from './upload/interface';
|
|
13
13
|
export * from './create/index';
|
|
14
14
|
export type { ClassStylePolicy, IClassStyleUnsupportedPayload, IEditorConfig, ISingleMenuConfig, IToolbarConfig, IUploadImageConfig, IUploadVideoConfig, StyleClassTokenType, TextStyleMode, } from './config/interface';
|
|
15
|
+
export { EditorEvents } from './config/interface';
|
|
15
16
|
export * from './config/style-mode';
|
|
16
17
|
export * from './editor/dom-editor';
|
|
17
18
|
export * from './editor/interface';
|
|
@@ -35,6 +36,7 @@ export interface IModuleConf {
|
|
|
35
36
|
renderStyle: RenderStyleFnType;
|
|
36
37
|
renderElems: Array<IRenderElemConf>;
|
|
37
38
|
styleToHtml: styleToHtmlFnType;
|
|
39
|
+
htmlTransform?: HtmlTransformFnType;
|
|
38
40
|
elemsToHtml: Array<IElemToHtmlConf>;
|
|
39
41
|
preParseHtml: Array<IPreParseHtmlConf>;
|
|
40
42
|
parseStyleHtml: ParseStyleHtmlFnType;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Descendant, Element as SlateElement } from 'slate';
|
|
6
6
|
import { IDomEditor } from '../editor/interface';
|
|
7
|
+
import type { INodeToHtmlOptions } from './node2html';
|
|
7
8
|
export type styleToHtmlFnType = (node: Descendant, elemHtml: string, editor?: IDomEditor) => string;
|
|
8
9
|
export declare const STYLE_TO_HTML_FN_LIST: styleToHtmlFnType[];
|
|
9
10
|
/**
|
|
@@ -11,6 +12,17 @@ export declare const STYLE_TO_HTML_FN_LIST: styleToHtmlFnType[];
|
|
|
11
12
|
* @param fn 处理 toHtml 文本样式的函数
|
|
12
13
|
*/
|
|
13
14
|
export declare function registerStyleToHtmlHandler(fn: styleToHtmlFnType): void;
|
|
15
|
+
/**
|
|
16
|
+
* Transform the HTML fragments of the document's top-level nodes.
|
|
17
|
+
*
|
|
18
|
+
* Element serializers intentionally stay node-local. Modules that need
|
|
19
|
+
* neighboring blocks to produce valid HTML (for example semantic lists) use
|
|
20
|
+
* this hook after every node has been serialized.
|
|
21
|
+
*/
|
|
22
|
+
export type HtmlTransformFnType = (htmlList: string[], nodes: Descendant[], editor: IDomEditor, options: INodeToHtmlOptions) => string[];
|
|
23
|
+
export declare const HTML_TRANSFORM_HANDLER_LIST: HtmlTransformFnType[];
|
|
24
|
+
export declare function registerHtmlTransformHandler(fn: HtmlTransformFnType): void;
|
|
25
|
+
export declare function transformHtml(htmlList: string[], nodes: Descendant[], editor: IDomEditor, options?: INodeToHtmlOptions): string[];
|
|
14
26
|
interface IElemToHtmlRes {
|
|
15
27
|
html: string;
|
|
16
28
|
prefix?: string;
|