@wangeditor-next/core 1.9.6 → 1.9.8

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,41 @@
2
2
  * @description config interface
3
3
  * @author wangfupeng
4
4
  */
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
5
  import type { Descendant, Node, NodeEntry, Range } from 'slate';
8
6
  import type { IDomEditor } from '../editor/interface';
9
7
  import type { IMenuGroup } from '../menus/interface';
10
8
  import type { IUploadConfig } from '../upload/interface';
11
9
  import type { DOMElement } from '../utils/dom';
10
+ type EmptyText = {
11
+ text: '';
12
+ };
13
+ type ImageElement = {
14
+ type: 'image';
15
+ src: string;
16
+ alt?: string;
17
+ href?: string;
18
+ width?: string;
19
+ height?: string;
20
+ style?: {
21
+ width?: string;
22
+ height?: string;
23
+ };
24
+ children: EmptyText[];
25
+ };
26
+ type VideoElement = {
27
+ type: 'video';
28
+ key?: string;
29
+ src: string;
30
+ poster?: string;
31
+ align?: 'left' | 'center' | 'right';
32
+ width?: string;
33
+ height?: string;
34
+ style?: {
35
+ width?: string;
36
+ height?: string;
37
+ };
38
+ children: EmptyText[];
39
+ };
12
40
  interface IHoverbarConf {
13
41
  [key: string]: {
14
42
  match?: (editor: IDomEditor, n: Node) => boolean;
@@ -2,15 +2,28 @@
2
2
  * @description editor interface
3
3
  * @author wangfupeng
4
4
  */
5
- import { NodeEntryWithContext } from '@wangeditor-next/table-module/src/utils';
6
5
  import ee from 'event-emitter';
7
- import { Ancestor, Editor, Element, Location, Node } from 'slate';
6
+ import { Ancestor, Editor, Element, Location, Node, NodeEntry } from 'slate';
8
7
  import { AlertType, IEditorConfig, IMenuConfig, ISingleMenuConfig } from '../config/interface';
9
8
  import { IPositionStyle } from '../menus/interface';
10
9
  import { DOMElement } from '../utils/dom';
11
10
  export type ElementWithId = Element & {
12
11
  id: string;
13
12
  };
13
+ export type TableSelectionEntry = [
14
+ NodeEntry<Element & {
15
+ type: unknown;
16
+ rowSpan?: number;
17
+ colSpan?: number;
18
+ hidden?: boolean;
19
+ }>,
20
+ {
21
+ rtl: number;
22
+ ltr: number;
23
+ ttb: number;
24
+ btt: number;
25
+ }
26
+ ];
14
27
  type MoveOptions = Parameters<Editor['move']>[0];
15
28
  export type getMenuConfigReturnType<K> = K extends keyof IMenuConfig ? IMenuConfig[K] : ISingleMenuConfig;
16
29
  /**
@@ -59,7 +72,7 @@ export interface IDomEditor extends Editor {
59
72
  move(distance: number, reverse?: boolean): void;
60
73
  moveReverse: (distance: number) => void;
61
74
  restoreSelection: () => void;
62
- getTableSelection?: () => NodeEntryWithContext[][] | null;
75
+ getTableSelection?: () => TableSelectionEntry[][] | null;
63
76
  getSelectionPosition: () => Partial<IPositionStyle>;
64
77
  getNodePosition: (node: Node) => Partial<IPositionStyle>;
65
78
  isSelectedAll: () => boolean;
@@ -11,7 +11,7 @@ import type { 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
- export type { ClassStylePolicy, IClassStyleUnsupportedPayload, IEditorConfig, IToolbarConfig, IUploadImageConfig, IUploadVideoConfig, StyleClassTokenType, TextStyleMode, } from './config/interface';
14
+ export type { ClassStylePolicy, IClassStyleUnsupportedPayload, IEditorConfig, ISingleMenuConfig, IToolbarConfig, IUploadImageConfig, IUploadVideoConfig, StyleClassTokenType, TextStyleMode, } from './config/interface';
15
15
  export * from './config/style-mode';
16
16
  export * from './editor/dom-editor';
17
17
  export * from './editor/interface';
@@ -2,6 +2,5 @@
2
2
  * @description formats helper
3
3
  * @author wangfupeng
4
4
  */
5
- import { ElementType } from 'packages/custom-types';
6
- export declare function genElemId(type: ElementType, id: string): string;
5
+ export declare function genElemId(type: string, id: string): string;
7
6
  export declare function genTextId(id: string): string;