@wangeditor-next/plugin-float-image 6.3.0 → 6.4.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/basic-modules/src/modules/code-block/menu/CodeBlockMenu.d.ts +1 -0
- package/dist/core/src/create/index.d.ts +2 -1
- package/dist/core/src/editor/interface.d.ts +3 -1
- package/dist/table-module/src/module/custom-types.d.ts +3 -2
- package/dist/table-module/src/module/helpers.d.ts +11 -1
- package/dist/table-module/src/module/pre-parse-html.d.ts +1 -1
- package/package.json +2 -2
|
@@ -8,6 +8,7 @@ declare class CodeBlockMenu implements IButtonMenu {
|
|
|
8
8
|
readonly iconSvg = "<svg viewBox=\"0 0 1280 1024\"><path d=\"M832 736l96 96 320-320L928 192l-96 96 224 224zM448 288l-96-96L32 512l320 320 96-96-224-224zM701.312 150.528l69.472 18.944-192 704.032-69.472-18.944 192-704.032z\"></path></svg>";
|
|
9
9
|
readonly tag = "button";
|
|
10
10
|
private getSelectCodeElem;
|
|
11
|
+
private getSelectedTableCellBlock;
|
|
11
12
|
/**
|
|
12
13
|
* 获取语言类型
|
|
13
14
|
* @param editor editor
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
5
|
import ee from 'event-emitter';
|
|
6
|
-
import { Ancestor, Editor, Element, Location, Node, NodeEntry } from 'slate';
|
|
6
|
+
import { Ancestor, Descendant, Editor, Element, Location, Node, NodeEntry } from 'slate';
|
|
7
7
|
import { AlertType, IEditorConfig, IMenuConfig, ISingleMenuConfig } from '../config/interface';
|
|
8
8
|
import { IPositionStyle } from '../menus/interface';
|
|
9
9
|
import { DOMElement } from '../utils/dom';
|
|
@@ -46,6 +46,8 @@ export interface IDomEditor extends Editor {
|
|
|
46
46
|
getParentNode: (node: Node) => Ancestor | null;
|
|
47
47
|
isEmpty: () => boolean;
|
|
48
48
|
clear: () => void;
|
|
49
|
+
/** Transform loaded content before Core binds node paths and renders the editor. */
|
|
50
|
+
transformInitialContent?: (content: Descendant[]) => Descendant[];
|
|
49
51
|
dangerouslyInsertHtml: (html: string, isRecursive?: boolean) => void;
|
|
50
52
|
setHtml: (html: string) => void;
|
|
51
53
|
id: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description 自定义 element
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { Descendant } from 'slate';
|
|
6
6
|
export type TableCellProperty = {
|
|
7
7
|
/** 用于设置单元格属性 */
|
|
8
8
|
backgroundColor?: string;
|
|
@@ -18,7 +18,8 @@ export type TableCellElement = {
|
|
|
18
18
|
colSpan?: number;
|
|
19
19
|
rowSpan?: number;
|
|
20
20
|
width?: string;
|
|
21
|
-
|
|
21
|
+
/** Cell content can contain block descendants. Legacy Text[] cells remain supported. */
|
|
22
|
+
children: Descendant[];
|
|
22
23
|
/** 用于设置单元格的 display 属性 */
|
|
23
24
|
hidden?: boolean;
|
|
24
25
|
} & TableCellProperty;
|
|
@@ -3,8 +3,18 @@
|
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
5
|
import { IDomEditor } from '@wangeditor-next/core';
|
|
6
|
-
import { Element as SlateElement } from 'slate';
|
|
6
|
+
import { Descendant, Element as SlateElement } from 'slate';
|
|
7
7
|
import { TableCellElement, TableElement } from './custom-types';
|
|
8
|
+
export declare function createEmptyTableCell(properties?: Omit<Partial<TableCellElement>, 'type' | 'children'>): TableCellElement;
|
|
9
|
+
export declare function cloneTableCellChildren(children: Descendant[]): Descendant[];
|
|
10
|
+
export declare function normalizeTableCellChildren(children: Descendant[]): Descendant[];
|
|
11
|
+
/**
|
|
12
|
+
* Return whether a block node is safe to keep directly under a table cell.
|
|
13
|
+
* The list is intentionally explicit so arbitrary custom blocks cannot bypass
|
|
14
|
+
* table selection and keyboard invariants by being pasted into a cell.
|
|
15
|
+
*/
|
|
16
|
+
export declare function isSupportedTableCellBlock(editor: IDomEditor, node: Descendant): boolean;
|
|
17
|
+
export declare function normalizeTableContent(content: Descendant[]): Descendant[];
|
|
8
18
|
/**
|
|
9
19
|
* Update a rendered table by its own path instead of relying on the current selection.
|
|
10
20
|
*/
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { DOMElement } from '../utils/dom';
|
|
6
6
|
/**
|
|
7
|
-
* pre-prase table
|
|
7
|
+
* pre-prase table and remove the tbody wrapper while preserving cell blocks.
|
|
8
8
|
* @param table table elem
|
|
9
9
|
*/
|
|
10
10
|
declare function preParse(tableElem: DOMElement): DOMElement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wangeditor-next/plugin-float-image",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.1",
|
|
4
4
|
"description": "wangEditor float image plugin",
|
|
5
5
|
"author": "cycleccc <2991205548@qq.com>",
|
|
6
6
|
"type": "module",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"dom7": "^3.0.0 || ^4.0.0",
|
|
38
38
|
"slate": "^0.124.0",
|
|
39
39
|
"snabbdom": "^3.6.0",
|
|
40
|
-
"@wangeditor-next/editor": "^6.
|
|
40
|
+
"@wangeditor-next/editor": "^6.4.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@wangeditor-next-shared/rollup-config": "^0.0.2"
|