@wangeditor-next/code-highlight 6.4.1 → 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.
@@ -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;
@@ -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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wangeditor-next/code-highlight",
3
- "version": "6.4.1",
3
+ "version": "6.4.2",
4
4
  "description": "wangEditor code-highlight module",
5
5
  "author": "cycleccc <2991205548@qq.com>",
6
6
  "type": "module",
@@ -38,7 +38,7 @@
38
38
  "dom7": "^3.0.0 || ^4.0.0",
39
39
  "slate": "^0.124.0",
40
40
  "snabbdom": "^3.6.0",
41
- "@wangeditor-next/core": "^6.4.1"
41
+ "@wangeditor-next/core": "^6.4.2"
42
42
  },
43
43
  "dependencies": {
44
44
  "prismjs": "^1.23.0"