@wangeditor-next/editor 6.0.2 → 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.
@@ -7,6 +7,9 @@ declare const _default: {
7
7
  unOrderedList: string;
8
8
  orderedList: string;
9
9
  lowerAlphaList: string;
10
+ numberingActions: string;
11
+ continueNumbering: string;
12
+ restartNumbering: string;
10
13
  };
11
14
  };
12
15
  export default _default;
@@ -7,6 +7,9 @@ declare const _default: {
7
7
  unOrderedList: string;
8
8
  orderedList: string;
9
9
  lowerAlphaList: string;
10
+ numberingActions: string;
11
+ continueNumbering: string;
12
+ restartNumbering: string;
10
13
  };
11
14
  };
12
15
  export default _default;
@@ -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 table menu helpers
3
- * @author wangfupeng
2
+ * @description list helpers
4
3
  */
5
4
  import { IDomEditor } from '@wangeditor-next/core';
6
- import { ListItemElement, OrderedListType } from './custom-types';
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 menu
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 getListNode;
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;
@@ -1,6 +1,5 @@
1
1
  /**
2
- * @description parse elem html
3
- * @author wangfupeng
2
+ * @description parse list HTML
4
3
  */
5
4
  import { IDomEditor } from '@wangeditor-next/core';
6
5
  import { Descendant } from 'slate';
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @description editor 插件,重写 editor API
2
+ * @description list editor plugin
3
3
  * @author wangfupeng
4
4
  */
5
5
  import { IDomEditor } from '@wangeditor-next/core';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wangeditor-next/editor",
3
- "version": "6.0.2",
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.1.0",
69
+ "@wangeditor-next/basic-modules": "3.2.0",
70
70
  "@wangeditor-next/code-highlight": "3.0.2",
71
- "@wangeditor-next/core": "1.9.8",
72
- "@wangeditor-next/list-module": "3.0.4",
71
+ "@wangeditor-next/core": "1.10.0",
72
+ "@wangeditor-next/list-module": "3.1.0",
73
73
  "@wangeditor-next/table-module": "3.0.10",
74
- "@wangeditor-next/upload-image-module": "4.0.0",
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",