@wangeditor-next/editor 5.6.54 → 5.6.56
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/url.d.ts +10 -0
- package/dist/core/src/config/interface.d.ts +11 -8
- package/dist/core/src/index.d.ts +6 -6
- package/dist/core/src/menus/bar/Toolbar.d.ts +1 -0
- package/dist/core/src/menus/bar-item/BaseButton.d.ts +1 -1
- package/dist/core/src/menus/index.d.ts +2 -2
- package/dist/core/src/upload/index.d.ts +3 -2
- package/dist/core/src/upload/interface.d.ts +2 -2
- package/dist/editor/src/Boot.d.ts +3 -2
- package/dist/editor/src/create.d.ts +3 -2
- package/dist/editor/src/index.d.ts +4 -2
- package/dist/editor/src/register-builtin-modules/register.d.ts +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/package.json +8 -8
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description normalize link url
|
|
3
|
+
* @author OpenAI
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Normalize URLs imported from HTML editors such as Microsoft Office.
|
|
7
|
+
* Formatting whitespace inside href values should not survive as literal
|
|
8
|
+
* line breaks, while real spaces should be serialized as %20.
|
|
9
|
+
*/
|
|
10
|
+
export declare function normalizeLinkUrl(url: string): string;
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
* @description config interface
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
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 { Descendant, Node, NodeEntry, Range } from 'slate';
|
|
8
|
-
import { IDomEditor } from '../editor/interface';
|
|
9
|
-
import { IMenuGroup } from '../menus/interface';
|
|
10
|
-
import { IUploadConfig } from '../upload';
|
|
11
|
-
import { DOMElement } from '../utils/dom';
|
|
5
|
+
import type { ImageElement } from 'packages/basic-modules/src/modules/image/custom-types';
|
|
6
|
+
import type { VideoElement } from 'packages/video-module/src/module/custom-types';
|
|
7
|
+
import type { Descendant, Node, NodeEntry, Range } from 'slate';
|
|
8
|
+
import type { IDomEditor } from '../editor/interface';
|
|
9
|
+
import type { IMenuGroup } from '../menus/interface';
|
|
10
|
+
import type { IUploadConfig } from '../upload';
|
|
11
|
+
import type { DOMElement } from '../utils/dom';
|
|
12
12
|
interface IHoverbarConf {
|
|
13
13
|
[key: string]: {
|
|
14
14
|
match?: (editor: IDomEditor, n: Node) => boolean;
|
|
@@ -175,6 +175,9 @@ export interface IMenuConfig {
|
|
|
175
175
|
uploadImage: IUploadImageConfig;
|
|
176
176
|
codeSelectLang: ICodeLangConfig;
|
|
177
177
|
}
|
|
178
|
+
export type IMenuConfigUpdate = {
|
|
179
|
+
[K in keyof IMenuConfig]?: Partial<IMenuConfig[K]>;
|
|
180
|
+
};
|
|
178
181
|
/**
|
|
179
182
|
* editor config
|
|
180
183
|
*/
|
|
@@ -205,7 +208,7 @@ export interface IEditorConfig {
|
|
|
205
208
|
autoFocus: boolean;
|
|
206
209
|
decorate?: (nodeEntry: NodeEntry) => Range[];
|
|
207
210
|
maxLength?: number;
|
|
208
|
-
MENU_CONF?:
|
|
211
|
+
MENU_CONF?: IMenuConfigUpdate;
|
|
209
212
|
hoverbarKeys?: IHoverbarConf;
|
|
210
213
|
EXTEND_CONF?: any;
|
|
211
214
|
skipCacheTypes?: string[];
|
package/dist/core/src/index.d.ts
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
5
|
import './assets/index.less';
|
|
6
|
-
import { IDomEditor } from './editor/interface';
|
|
7
|
-
import { IRegisterMenuConf } from './menus/index';
|
|
8
|
-
import { IParseElemHtmlConf, IPreParseHtmlConf, ParseStyleHtmlFnType } from './parse-html/index';
|
|
9
|
-
import { IRenderElemConf, RenderStyleFnType } from './render/index';
|
|
10
|
-
import { IElemToHtmlConf, styleToHtmlFnType } from './to-html/index';
|
|
6
|
+
import type { IDomEditor } from './editor/interface';
|
|
7
|
+
import type { IRegisterMenuConf } from './menus/index';
|
|
8
|
+
import type { IParseElemHtmlConf, IPreParseHtmlConf, ParseStyleHtmlFnType } from './parse-html/index';
|
|
9
|
+
import type { IRenderElemConf, RenderStyleFnType } from './render/index';
|
|
10
|
+
import type { IElemToHtmlConf, styleToHtmlFnType } from './to-html/index';
|
|
11
11
|
export * from './create/index';
|
|
12
|
-
export { IEditorConfig, IToolbarConfig, IUploadImageConfig, IUploadVideoConfig, } from './config/interface';
|
|
12
|
+
export type { IEditorConfig, IToolbarConfig, IUploadImageConfig, IUploadVideoConfig, } from './config/interface';
|
|
13
13
|
export * from './editor/dom-editor';
|
|
14
14
|
export * from './editor/interface';
|
|
15
15
|
export * from './render/index';
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @description base button class
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IButtonMenu, IDropPanelMenu, IModalMenu } from '../interface';
|
|
6
5
|
import { Dom7Array } from '../../utils/dom';
|
|
6
|
+
import { IButtonMenu, IDropPanelMenu, IModalMenu } from '../interface';
|
|
7
7
|
import { IBarItem } from './index';
|
|
8
8
|
declare abstract class BaseButton implements IBarItem {
|
|
9
9
|
readonly $elem: Dom7Array;
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import Toolbar from './bar/Toolbar';
|
|
6
6
|
export { registerMenu } from './register';
|
|
7
|
-
export { IButtonMenu,
|
|
8
|
-
export {
|
|
7
|
+
export type { IButtonMenu, IDropPanelMenu, IModalMenu, IOption, IRegisterMenuConf, ISelectMenu, } from './interface';
|
|
8
|
+
export { genModalButtonElems, genModalInputElems, genModalTextareaElems, } from './panel-and-modal/Modal';
|
|
9
9
|
export { Toolbar };
|
|
@@ -3,5 +3,6 @@
|
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
5
|
import createUploader from './createUploader';
|
|
6
|
-
import { IUploadConfig } from './interface';
|
|
7
|
-
export { createUploader
|
|
6
|
+
import type { IUploadConfig } from './interface';
|
|
7
|
+
export { createUploader };
|
|
8
|
+
export type { IUploadConfig };
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @description upload interface
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { UppyFile } from '@uppy/core';
|
|
6
|
-
import { IDomEditor } from '../editor/interface';
|
|
5
|
+
import type { UppyFile } from '@uppy/core';
|
|
6
|
+
import type { IDomEditor } from '../editor/interface';
|
|
7
7
|
type FilesType = {
|
|
8
8
|
[key: string]: UppyFile<{}, {}>;
|
|
9
9
|
};
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* @description Editor View class
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import type { IEditorConfig, IElemToHtmlConf, IModuleConf, IParseElemHtmlConf, IPreParseHtmlConf, IRegisterMenuConf, IRenderElemConf, IToolbarConfig, ParseStyleHtmlFnType, RenderStyleFnType, styleToHtmlFnType } from '@wangeditor-next/core';
|
|
6
|
+
import { IDomEditor } from '@wangeditor-next/core';
|
|
7
|
+
import type { ISingleMenuConfig } from 'packages/core/src/config/interface';
|
|
7
8
|
type PluginType = <T extends IDomEditor>(editor: T) => T;
|
|
8
9
|
declare class Boot {
|
|
9
10
|
constructor();
|
|
@@ -2,9 +2,10 @@
|
|
|
2
2
|
* @description create
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
+
import type { IEditorConfig, IToolbarConfig } from '@wangeditor-next/core';
|
|
6
|
+
import { IDomEditor, Toolbar } from '@wangeditor-next/core';
|
|
5
7
|
import { Descendant } from 'slate';
|
|
6
|
-
import { DOMElement } from './utils/dom';
|
|
7
|
-
import { IEditorConfig, IDomEditor, IToolbarConfig, Toolbar } from '@wangeditor-next/core';
|
|
8
|
+
import type { DOMElement } from './utils/dom';
|
|
8
9
|
export interface ICreateEditorOption {
|
|
9
10
|
selector: string | DOMElement;
|
|
10
11
|
config: Partial<IEditorConfig>;
|
|
@@ -10,8 +10,10 @@ import './register-builtin-modules/index';
|
|
|
10
10
|
import './init-default-config';
|
|
11
11
|
import Boot from './Boot';
|
|
12
12
|
export { Boot };
|
|
13
|
-
export {
|
|
14
|
-
export {
|
|
13
|
+
export type { IButtonMenu, IDomEditor, IDropPanelMenu, IEditorConfig, IModalMenu, IModuleConf, ISelectMenu, IToolbarConfig, IUploadConfig, } from '@wangeditor-next/core';
|
|
14
|
+
export { createUploader, DomEditor, genModalButtonElems, genModalInputElems, genModalTextareaElems, i18nAddResources, i18nChangeLanguage, i18nGetResources, t, Toolbar, } from '@wangeditor-next/core';
|
|
15
|
+
export type { Descendant as SlateDescendant, Location as SlateLocation, } from 'slate';
|
|
16
|
+
export { Editor as SlateEditor, Element as SlateElement, Node as SlateNode, Path as SlatePath, Point as SlatePoint, Range as SlateRange, Text as SlateText, Transforms as SlateTransforms, } from 'slate';
|
|
15
17
|
export { createEditor, createToolbar } from './create';
|
|
16
18
|
declare const _default: {};
|
|
17
19
|
export default _default;
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* @description 注册 module
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IModuleConf } from '@wangeditor-next/core';
|
|
5
|
+
import type { IModuleConf } from '@wangeditor-next/core';
|
|
6
6
|
declare function registerModule(module: Partial<IModuleConf>): void;
|
|
7
7
|
export default registerModule;
|