@wangeditor-next/core 6.4.0 → 6.4.2
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/core/src/config/interface.d.ts +22 -0
- package/dist/core/src/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -112,6 +112,27 @@ interface IInsertImageConfig extends IImageMenuBaseConfig {
|
|
|
112
112
|
interface IEditImageConfig extends IImageMenuBaseConfig {
|
|
113
113
|
onUpdatedImage?: (imageNode: ImageElement | null) => void;
|
|
114
114
|
}
|
|
115
|
+
export type ImageResizeUnit = 'px' | '%';
|
|
116
|
+
export type ImageResizeSource = 'modal' | 'preset' | 'drag';
|
|
117
|
+
export interface IImageResizeCheckPayload {
|
|
118
|
+
width: string;
|
|
119
|
+
height: string;
|
|
120
|
+
rawWidth: string;
|
|
121
|
+
rawHeight: string;
|
|
122
|
+
source: ImageResizeSource;
|
|
123
|
+
}
|
|
124
|
+
export interface IImageResizeOption {
|
|
125
|
+
label: string;
|
|
126
|
+
value: string;
|
|
127
|
+
}
|
|
128
|
+
export interface IImageResizeConfig {
|
|
129
|
+
/** Resize unit for editor-owned image resize actions. Omit to preserve legacy behavior. */
|
|
130
|
+
resizeUnit?: ImageResizeUnit;
|
|
131
|
+
/** Values for the built-in 30%/50%/100% preset buttons, in their existing order. */
|
|
132
|
+
resizeOptions?: IImageResizeOption[];
|
|
133
|
+
/** Validate normalized image dimensions before they are written to the document. */
|
|
134
|
+
checkImageSize?: (payload: IImageResizeCheckPayload) => boolean | undefined | string;
|
|
135
|
+
}
|
|
115
136
|
interface IEmotionConfig {
|
|
116
137
|
emotions: string[];
|
|
117
138
|
}
|
|
@@ -281,6 +302,7 @@ export interface IEditorConfig {
|
|
|
281
302
|
autoFocus: boolean;
|
|
282
303
|
decorate?: (nodeEntry: NodeEntry) => Range[];
|
|
283
304
|
maxLength?: number;
|
|
305
|
+
imageResize?: IImageResizeConfig;
|
|
284
306
|
MENU_CONF?: IMenuConfigUpdate;
|
|
285
307
|
hoverbarKeys?: IHoverbarConf;
|
|
286
308
|
EXTEND_CONF?: any;
|
package/dist/core/src/index.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type { HtmlTransformFnType, IElemToHtmlConf, styleToHtmlFnType } from './
|
|
|
11
11
|
import createUploaderRuntime from './upload/createUploader';
|
|
12
12
|
import type { IUploadConfig } from './upload/interface';
|
|
13
13
|
export * from './create/index';
|
|
14
|
-
export type { ClassStylePolicy, IClassStyleUnsupportedPayload, IEditorConfig, ISingleMenuConfig, IToolbarConfig, IUploadImageConfig, IUploadVideoConfig, StyleClassTokenType, TextStyleMode, } from './config/interface';
|
|
14
|
+
export type { ClassStylePolicy, IClassStyleUnsupportedPayload, IEditorConfig, IImageResizeCheckPayload, IImageResizeConfig, IImageResizeOption, ImageResizeSource, ImageResizeUnit, ISingleMenuConfig, IToolbarConfig, IUploadImageConfig, IUploadVideoConfig, StyleClassTokenType, TextStyleMode, } from './config/interface';
|
|
15
15
|
export { EditorEvents } from './config/interface';
|
|
16
16
|
export * from './config/style-mode';
|
|
17
17
|
export * from './editor/dom-editor';
|