@wangeditor-next/editor 6.0.0 → 6.0.2

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.
@@ -3,4 +3,5 @@
3
3
  * @author wangfupeng
4
4
  */
5
5
  import { IDomEditor } from '@wangeditor-next/core';
6
- export declare const ELEM_TO_EDITOR: WeakMap<import("packages/custom-types").CustomElement, IDomEditor>;
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): import("slate").NodeEntry<import("../../utils").WithType<import("packages/custom-types").CustomElement>>;
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): import("slate").NodeEntry<import("../../utils").WithType<import("packages/custom-types").CustomElement>>;
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 }: {
@@ -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;
@@ -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<import("slate").BaseEditor, NodeEntryWithContext[][]>;
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<import("slate").BaseEditor, WeakSet<import("packages/custom-types").CustomElement>>;
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/editor",
3
- "version": "6.0.0",
3
+ "version": "6.0.2",
4
4
  "description": "Web rich text editor, Web 富文本编辑器",
5
5
  "keywords": [
6
6
  "wangeditor",
@@ -14,6 +14,16 @@
14
14
  "homepage": "https://github.com/wangeditor-next/wangEditor-next#readme",
15
15
  "license": "MIT",
16
16
  "types": "dist/editor/src/index.d.ts",
17
+ "typesVersions": {
18
+ "*": {
19
+ "core": [
20
+ "dist/editor/src/core.d.ts"
21
+ ],
22
+ "upload": [
23
+ "dist/editor/src/upload.d.ts"
24
+ ]
25
+ }
26
+ },
17
27
  "main": "dist/index.js",
18
28
  "module": "dist/index.mjs",
19
29
  "exports": {
@@ -58,9 +68,9 @@
58
68
  "@uppy/xhr-upload": "^5.0.0",
59
69
  "@wangeditor-next/basic-modules": "3.1.0",
60
70
  "@wangeditor-next/code-highlight": "3.0.2",
61
- "@wangeditor-next/core": "1.9.6",
62
- "@wangeditor-next/list-module": "3.0.3",
63
- "@wangeditor-next/table-module": "3.0.8",
71
+ "@wangeditor-next/core": "1.9.8",
72
+ "@wangeditor-next/list-module": "3.0.4",
73
+ "@wangeditor-next/table-module": "3.0.10",
64
74
  "@wangeditor-next/upload-image-module": "4.0.0",
65
75
  "@wangeditor-next/video-module": "4.0.0",
66
76
  "dom7": "^4.0.0",