@wangeditor-next/editor 6.0.1 → 6.1.0
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/basic-modules/src/modules/header/parse-elem-html.d.ts +2 -2
- package/dist/core/src/index.d.ts +3 -1
- package/dist/core/src/to-html/index.d.ts +12 -0
- package/dist/core.js +1 -1
- package/dist/core.mjs +1 -1
- package/dist/css/style.css +2 -2
- package/dist/editor/src/Boot.d.ts +2 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +3 -3
- package/dist/list-module/src/locale/en.d.ts +3 -0
- package/dist/list-module/src/locale/zh-CN.d.ts +3 -0
- package/dist/list-module/src/module/custom-types.d.ts +13 -0
- package/dist/list-module/src/module/helpers.d.ts +14 -4
- package/dist/list-module/src/module/html-transform.d.ts +10 -0
- package/dist/list-module/src/module/menu/BaseMenu.d.ts +2 -2
- package/dist/list-module/src/module/outline-actions.d.ts +9 -0
- package/dist/list-module/src/module/parse-elem-html.d.ts +1 -2
- package/dist/list-module/src/module/plugin.d.ts +1 -1
- package/dist/table-module/src/module/render-elem/selection-overlay.d.ts +21 -0
- package/package.json +6 -6
|
@@ -4,11 +4,24 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Text } from 'slate';
|
|
6
6
|
export type OrderedListType = '1' | 'a' | 'A' | 'i' | 'I';
|
|
7
|
+
/**
|
|
8
|
+
* An outline keeps the established list-item wire format and records the
|
|
9
|
+
* heading semantics as additive metadata.
|
|
10
|
+
*/
|
|
11
|
+
export type HeadingType = 'header1' | 'header2' | 'header3' | 'header4' | 'header5' | 'header6';
|
|
7
12
|
export type ListItemElement = {
|
|
8
13
|
type: 'list-item';
|
|
9
14
|
ordered: boolean;
|
|
10
15
|
level: number;
|
|
11
16
|
start?: number;
|
|
12
17
|
orderType?: OrderedListType;
|
|
18
|
+
headingType?: HeadingType;
|
|
19
|
+
listMode?: 'outline';
|
|
20
|
+
listRestart?: number;
|
|
13
21
|
children: Text[];
|
|
14
22
|
};
|
|
23
|
+
export type OutlineListItemElement = ListItemElement & {
|
|
24
|
+
ordered: true;
|
|
25
|
+
headingType: HeadingType;
|
|
26
|
+
listMode: 'outline';
|
|
27
|
+
};
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @description
|
|
3
|
-
* @author wangfupeng
|
|
2
|
+
* @description list helpers
|
|
4
3
|
*/
|
|
5
4
|
import { IDomEditor } from '@wangeditor-next/core';
|
|
6
|
-
import {
|
|
5
|
+
import { Node } from 'slate';
|
|
6
|
+
import { HeadingType, ListItemElement, OrderedListType, OutlineListItemElement } from './custom-types';
|
|
7
|
+
export declare function isListNode(node: Node): node is ListItemElement;
|
|
8
|
+
export declare const isLegacyListItem: typeof isListNode;
|
|
9
|
+
export declare function isHeadingType(value: unknown): value is HeadingType;
|
|
10
|
+
export declare function getHeadingType(node: Node): HeadingType | null;
|
|
11
|
+
export declare function getListIndent(node: Node): number;
|
|
12
|
+
export declare function getListMode(node: Node): 'standard' | 'outline';
|
|
13
|
+
export declare function isOutlineListNode(node: Node): node is OutlineListItemElement;
|
|
14
|
+
export declare function getOutlineLevel(node: Node): number;
|
|
7
15
|
export declare function getNormalizedOrderedListStart(elem: ListItemElement): number;
|
|
8
16
|
export declare function getNormalizedOrderedListType(elem: ListItemElement): OrderedListType;
|
|
9
17
|
export declare function hasSameListConfig(a: ListItemElement, b: ListItemElement): boolean;
|
|
18
|
+
export declare function getOrderedItemNumber(editor: IDomEditor, elem: ListItemElement): number;
|
|
19
|
+
export declare function getOutlineNumber(editor: IDomEditor, elem: ListItemElement): string;
|
|
10
20
|
/**
|
|
11
21
|
* 获取上一个同一 level 的 list item
|
|
12
|
-
* @param editor
|
|
22
|
+
* @param editor editor
|
|
13
23
|
* @param elem elem
|
|
14
24
|
*/
|
|
15
25
|
export declare function getBrotherListNodeByLevel(editor: IDomEditor, elem: ListItemElement, level?: number): ListItemElement | null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description compose semantic outline HTML from additive list-item metadata
|
|
3
|
+
*/
|
|
4
|
+
import { HtmlTransformFnType } from '@wangeditor-next/core';
|
|
5
|
+
/**
|
|
6
|
+
* List-item serialization remains backward compatible for ordinary lists.
|
|
7
|
+
* Only outline list items need document-level composition to create valid
|
|
8
|
+
* `ol > li > hN` structure.
|
|
9
|
+
*/
|
|
10
|
+
export declare const transformListHtml: HtmlTransformFnType;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @description base
|
|
2
|
+
* @description list menu base class
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
5
|
import { IButtonMenu, IDomEditor } from '@wangeditor-next/core';
|
|
@@ -11,7 +11,7 @@ declare abstract class BaseMenu implements IButtonMenu {
|
|
|
11
11
|
abstract readonly title: string;
|
|
12
12
|
abstract readonly iconSvg: string;
|
|
13
13
|
readonly tag = "button";
|
|
14
|
-
private
|
|
14
|
+
private isTargetListNode;
|
|
15
15
|
getValue(_editor: IDomEditor): string | boolean;
|
|
16
16
|
isActive(editor: IDomEditor): boolean;
|
|
17
17
|
isDisabled(editor: IDomEditor): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description outline numbering marker actions
|
|
3
|
+
*/
|
|
4
|
+
import { IDomEditor } from '@wangeditor-next/core';
|
|
5
|
+
import { ListItemElement } from './custom-types';
|
|
6
|
+
export declare function continueOutlineNumbering(editor: IDomEditor, node: ListItemElement): void;
|
|
7
|
+
export declare function restartOutlineNumbering(editor: IDomEditor, node: ListItemElement): void;
|
|
8
|
+
export declare function hideOutlineActionPanel(editor: IDomEditor): void;
|
|
9
|
+
export declare function showOutlineActionPanel(editor: IDomEditor, node: ListItemElement, marker: HTMLElement): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { VNode } from 'snabbdom';
|
|
2
|
+
export type SelectionRect = {
|
|
3
|
+
top: number;
|
|
4
|
+
right: number;
|
|
5
|
+
bottom: number;
|
|
6
|
+
left: number;
|
|
7
|
+
};
|
|
8
|
+
export type SelectionPerimeterSide = 'top' | 'right' | 'bottom' | 'left';
|
|
9
|
+
export type SelectionPerimeterSegment = {
|
|
10
|
+
side: SelectionPerimeterSide;
|
|
11
|
+
offset: number;
|
|
12
|
+
start: number;
|
|
13
|
+
end: number;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Returns the physical perimeter of a set of non-overlapping cell rectangles. Opposing edges
|
|
17
|
+
* cancel only where they overlap, so partially exposed sides of merged cells remain precise.
|
|
18
|
+
*/
|
|
19
|
+
export declare function getSelectionPerimeterSegments(rects: SelectionRect[]): SelectionPerimeterSegment[];
|
|
20
|
+
export declare function drawSelectionOverlay(elm: Node | undefined): void;
|
|
21
|
+
export declare function renderSelectionOverlay(): VNode;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wangeditor-next/editor",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
4
4
|
"description": "Web rich text editor, Web 富文本编辑器",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wangeditor",
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
"dependencies": {
|
|
67
67
|
"@uppy/core": "^5.0.0",
|
|
68
68
|
"@uppy/xhr-upload": "^5.0.0",
|
|
69
|
-
"@wangeditor-next/basic-modules": "3.
|
|
69
|
+
"@wangeditor-next/basic-modules": "3.2.0",
|
|
70
70
|
"@wangeditor-next/code-highlight": "3.0.2",
|
|
71
|
-
"@wangeditor-next/core": "1.
|
|
72
|
-
"@wangeditor-next/list-module": "3.0
|
|
73
|
-
"@wangeditor-next/table-module": "3.0.
|
|
74
|
-
"@wangeditor-next/upload-image-module": "4.0.
|
|
71
|
+
"@wangeditor-next/core": "1.10.0",
|
|
72
|
+
"@wangeditor-next/list-module": "3.1.0",
|
|
73
|
+
"@wangeditor-next/table-module": "3.0.10",
|
|
74
|
+
"@wangeditor-next/upload-image-module": "4.0.1",
|
|
75
75
|
"@wangeditor-next/video-module": "4.0.0",
|
|
76
76
|
"dom7": "^4.0.0",
|
|
77
77
|
"is-hotkey": "^0.2.0",
|