@wangeditor-next/code-highlight 1.3.47 → 1.3.49

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.
@@ -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?: Partial<IMenuConfig>;
211
+ MENU_CONF?: IMenuConfigUpdate;
209
212
  hoverbarKeys?: IHoverbarConf;
210
213
  EXTEND_CONF?: any;
211
214
  skipCacheTypes?: string[];
@@ -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';
@@ -23,6 +23,7 @@ declare class Toolbar {
23
23
  private registerGroup;
24
24
  private registerSingleItem;
25
25
  private getEditorInstance;
26
+ private syncToolbarState;
26
27
  /**
27
28
  * editor onChange 时触发(涉及 DOM 操作,加防抖)
28
29
  */
@@ -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, ISelectMenu, IDropPanelMenu, IModalMenu, IRegisterMenuConf, IOption, } from './interface';
8
- export { genModalInputElems, genModalButtonElems, genModalTextareaElems, } from './panel-and-modal/Modal';
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 };
@@ -5,6 +5,7 @@
5
5
  import { Dom7Array, DOMElement } from '../utils/dom';
6
6
  declare class TextArea {
7
7
  private selectionChangeRoot;
8
+ private destroyed;
8
9
  readonly id: number;
9
10
  $box: Dom7Array;
10
11
  $textAreaContainer: Dom7Array;
@@ -21,6 +22,7 @@ declare class TextArea {
21
22
  private latestEditorSelection;
22
23
  constructor(boxSelector: string | DOMElement);
23
24
  private get editorInstance();
25
+ private getActiveEditor;
24
26
  private bindSelectionChange;
25
27
  private onDOMSelectionChange;
26
28
  flushDOMSelectionChange(): void;
@@ -3,5 +3,6 @@
3
3
  * @author wangfupeng
4
4
  */
5
5
  import createUploader from './createUploader';
6
- import { IUploadConfig } from './interface';
7
- export { createUploader, IUploadConfig };
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
  };