@wangeditor-next/plugin-ctrl-enter 3.0.0 → 3.0.1
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 +30 -2
- package/dist/core/src/editor/interface.d.ts +16 -3
- package/dist/core/src/index.d.ts +1 -1
- package/dist/core/src/render/helper.d.ts +1 -2
- package/dist/editor/src/Boot.d.ts +1 -2
- package/dist/list-module/src/utils/maps.d.ts +2 -1
- package/dist/table-module/src/module/menu/CellProperty.d.ts +2 -1
- package/dist/table-module/src/module/menu/TableProperty.d.ts +2 -1
- package/dist/table-module/src/module/weak-maps.d.ts +3 -2
- package/package.json +2 -2
|
@@ -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?: () =>
|
|
75
|
+
getTableSelection?: () => TableSelectionEntry[][] | null;
|
|
63
76
|
getSelectionPosition: () => Partial<IPositionStyle>;
|
|
64
77
|
getNodePosition: (node: Node) => Partial<IPositionStyle>;
|
|
65
78
|
isSelectedAll: () => boolean;
|
package/dist/core/src/index.d.ts
CHANGED
|
@@ -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
|
-
|
|
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;
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* @description Editor View class
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import type { IEditorConfig, IElemToHtmlConf, IModuleConf, IParseElemHtmlConf, IPreParseHtmlConf, IRegisterMenuConf, IRenderElemConf, IToolbarConfig, ParseStyleHtmlFnType, RenderStyleFnType, styleToHtmlFnType } from '@wangeditor-next/core';
|
|
5
|
+
import type { IEditorConfig, IElemToHtmlConf, IModuleConf, IParseElemHtmlConf, IPreParseHtmlConf, IRegisterMenuConf, IRenderElemConf, ISingleMenuConfig, IToolbarConfig, ParseStyleHtmlFnType, RenderStyleFnType, styleToHtmlFnType } from '@wangeditor-next/core';
|
|
6
6
|
import { IDomEditor } from '@wangeditor-next/core';
|
|
7
|
-
import type { ISingleMenuConfig } from 'packages/core/src/config/interface';
|
|
8
7
|
type PluginType = <T extends IDomEditor>(editor: T) => T;
|
|
9
8
|
declare class Boot {
|
|
10
9
|
constructor();
|
|
@@ -3,4 +3,5 @@
|
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
5
|
import { IDomEditor } from '@wangeditor-next/core';
|
|
6
|
-
|
|
6
|
+
import { BaseElement } from 'slate';
|
|
7
|
+
export declare const ELEM_TO_EDITOR: WeakMap<BaseElement, IDomEditor>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { IButtonMenu, IDomEditor } from '@wangeditor-next/core';
|
|
2
|
+
import { NodeEntry } from 'slate';
|
|
2
3
|
import TableProperty, { FieldName } from './TableProperty';
|
|
3
4
|
declare class CellProperty extends TableProperty implements IButtonMenu {
|
|
4
5
|
readonly title: string;
|
|
@@ -8,6 +9,6 @@ declare class CellProperty extends TableProperty implements IButtonMenu {
|
|
|
8
9
|
readonly modalWidth = 360;
|
|
9
10
|
readonly menu = "cell";
|
|
10
11
|
readonly propertyFields: FieldName[];
|
|
11
|
-
getModalContentNode(editor: IDomEditor):
|
|
12
|
+
getModalContentNode(editor: IDomEditor): NodeEntry;
|
|
12
13
|
}
|
|
13
14
|
export default CellProperty;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
* @author hsuna
|
|
4
4
|
*/
|
|
5
5
|
import { IButtonMenu, IDomEditor } from '@wangeditor-next/core';
|
|
6
|
+
import { NodeEntry } from 'slate';
|
|
6
7
|
export type FieldName = 'borderStyle' | 'borderColor' | 'borderWidth' | 'backgroundColor' | 'textAlign' | 'verticalAlign';
|
|
7
8
|
type SelectOption = {
|
|
8
9
|
value: string;
|
|
@@ -35,7 +36,7 @@ declare class TableProperty implements IButtonMenu {
|
|
|
35
36
|
isActive(_editor: IDomEditor): boolean;
|
|
36
37
|
isDisabled(editor: IDomEditor): boolean;
|
|
37
38
|
exec(_editor: IDomEditor, _value: string | boolean): void;
|
|
38
|
-
getModalContentNode(editor: IDomEditor):
|
|
39
|
+
getModalContentNode(editor: IDomEditor): NodeEntry;
|
|
39
40
|
getModalPositionNode(_editor: IDomEditor): null;
|
|
40
41
|
getModalContentElem(editor: IDomEditor): Element | null;
|
|
41
42
|
getPanelContentElem(editor: any, { mark, selectedColor, callback }: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { BaseEditor, BaseElement } from 'slate';
|
|
1
2
|
import { NodeEntryWithContext } from '../utils';
|
|
2
3
|
/** Weak reference between the `Editor` and the selected elements */
|
|
3
|
-
export declare const EDITOR_TO_SELECTION: WeakMap<
|
|
4
|
+
export declare const EDITOR_TO_SELECTION: WeakMap<BaseEditor, NodeEntryWithContext[][]>;
|
|
4
5
|
/** Weak reference between the `Editor` and a set of the selected elements */
|
|
5
|
-
export declare const EDITOR_TO_SELECTION_SET: WeakMap<
|
|
6
|
+
export declare const EDITOR_TO_SELECTION_SET: WeakMap<BaseEditor, WeakSet<BaseElement>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wangeditor-next/plugin-ctrl-enter",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "wangEditor ctrl+enter plugin",
|
|
5
5
|
"author": "cycleccc <2991205548@qq.com>",
|
|
6
6
|
"type": "module",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"url": "https://github.com/wangeditor-next/wangEditor-next/issues"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@wangeditor-next/editor": "6.0.
|
|
37
|
+
"@wangeditor-next/editor": "6.0.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@wangeditor-next-shared/rollup-config": "^0.0.2"
|