@wangeditor-kai/editor 5.6.38 → 5.6.40
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/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/blockquote/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/blockquote/menu/BlockquoteMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/blockquote/parse-elem-html.d.ts +1 -1
- package/dist/basic-modules/src/modules/blockquote/plugin.d.ts +1 -1
- package/dist/basic-modules/src/modules/blockquote/render-elem.d.ts +1 -1
- package/dist/basic-modules/src/modules/code-block/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/code-block/menu/CodeBlockMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/code-block/parse-elem-html.d.ts +1 -1
- package/dist/basic-modules/src/modules/code-block/plugin.d.ts +1 -1
- package/dist/basic-modules/src/modules/code-block/render-elem.d.ts +1 -1
- package/dist/basic-modules/src/modules/color/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/color/menu/BaseMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/color/parse-style-html.d.ts +1 -1
- package/dist/basic-modules/src/modules/common/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/common/menu/EnterMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/divider/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/divider/menu/InsertDividerMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/divider/parse-elem-html.d.ts +1 -1
- package/dist/basic-modules/src/modules/divider/plugin.d.ts +1 -1
- package/dist/basic-modules/src/modules/divider/render-elem.d.ts +1 -1
- package/dist/basic-modules/src/modules/emotion/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/emotion/menu/EmotionMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/font-size-family/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/font-size-family/menu/BaseMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/font-size-family/menu/FontFamilyMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/font-size-family/menu/FontSizeMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/font-size-family/parse-style-html.d.ts +1 -1
- package/dist/basic-modules/src/modules/format-painter/helper.d.ts +1 -1
- package/dist/basic-modules/src/modules/format-painter/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/format-painter/menu/FormatPainter.d.ts +1 -1
- package/dist/basic-modules/src/modules/format-painter/plugin.d.ts +1 -1
- package/dist/basic-modules/src/modules/full-screen/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/full-screen/menu/FullScreen.d.ts +1 -1
- package/dist/basic-modules/src/modules/header/helper.d.ts +1 -1
- package/dist/basic-modules/src/modules/header/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/header/menu/HeaderButtonMenuBase.d.ts +1 -1
- package/dist/basic-modules/src/modules/header/menu/HeaderSelectMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/header/parse-elem-html.d.ts +1 -1
- package/dist/basic-modules/src/modules/header/plugin.d.ts +1 -1
- package/dist/basic-modules/src/modules/header/render-elem.d.ts +1 -1
- package/dist/basic-modules/src/modules/image/helper.d.ts +1 -1
- package/dist/basic-modules/src/modules/image/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/image/menu/DeleteImage.d.ts +1 -1
- package/dist/basic-modules/src/modules/image/menu/EditImage.d.ts +1 -1
- package/dist/basic-modules/src/modules/image/menu/EditImageSizeMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/image/menu/InsertImage.d.ts +1 -1
- package/dist/basic-modules/src/modules/image/menu/ViewImageLink.d.ts +1 -1
- package/dist/basic-modules/src/modules/image/menu/WidthBase.d.ts +1 -1
- package/dist/basic-modules/src/modules/image/parse-elem-html.d.ts +1 -1
- package/dist/basic-modules/src/modules/image/plugin.d.ts +1 -1
- package/dist/basic-modules/src/modules/image/render-elem.d.ts +1 -1
- package/dist/basic-modules/src/modules/indent/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/indent/menu/BaseMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/indent/menu/DecreaseIndentMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/indent/menu/IncreaseIndentMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/indent/parse-style-html.d.ts +1 -1
- package/dist/basic-modules/src/modules/justify/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/justify/menu/BaseMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/justify/menu/JustifyCenterMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/justify/menu/JustifyJustifyMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/justify/menu/JustifyLeftMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/justify/menu/JustifyRightMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/justify/parse-style-html.d.ts +1 -1
- package/dist/basic-modules/src/modules/line-height/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/line-height/menu/LineHeightMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/line-height/parse-style-html.d.ts +1 -1
- package/dist/basic-modules/src/modules/link/helper.d.ts +1 -1
- package/dist/basic-modules/src/modules/link/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/link/menu/EditLink.d.ts +1 -1
- package/dist/basic-modules/src/modules/link/menu/InsertLink.d.ts +1 -1
- package/dist/basic-modules/src/modules/link/menu/UnLink.d.ts +1 -1
- package/dist/basic-modules/src/modules/link/menu/ViewLink.d.ts +1 -1
- package/dist/basic-modules/src/modules/link/parse-elem-html.d.ts +2 -2
- package/dist/basic-modules/src/modules/link/plugin.d.ts +1 -1
- package/dist/basic-modules/src/modules/link/render-elem.d.ts +1 -1
- package/dist/basic-modules/src/modules/paragraph/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/paragraph/parse-elem-html.d.ts +1 -1
- package/dist/basic-modules/src/modules/paragraph/plugin.d.ts +1 -1
- package/dist/basic-modules/src/modules/paragraph/render-elem.d.ts +1 -1
- package/dist/basic-modules/src/modules/text-style/helper.d.ts +1 -1
- package/dist/basic-modules/src/modules/text-style/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/text-style/menu/BaseMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/text-style/menu/ClearStyleMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/text-style/parse-style-html.d.ts +1 -1
- package/dist/basic-modules/src/modules/todo/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/todo/menu/Todo.d.ts +1 -1
- package/dist/basic-modules/src/modules/todo/parse-elem-html.d.ts +1 -1
- package/dist/basic-modules/src/modules/todo/plugin.d.ts +1 -1
- package/dist/basic-modules/src/modules/todo/render-elem.d.ts +1 -1
- package/dist/basic-modules/src/modules/undo-redo/index.d.ts +1 -1
- package/dist/basic-modules/src/modules/undo-redo/menu/RedoMenu.d.ts +1 -1
- package/dist/basic-modules/src/modules/undo-redo/menu/UndoMenu.d.ts +1 -1
- package/dist/code-highlight/src/module/index.d.ts +1 -1
- package/dist/code-highlight/src/module/menu/SelectLangMenu.d.ts +1 -1
- package/dist/code-highlight/src/module/parse-style-html.d.ts +1 -1
- package/dist/css/style.css +8 -1
- package/dist/editor/src/index.d.ts +1 -1
- package/dist/editor/src/register-builtin-modules/index.d.ts +6 -6
- package/dist/index.js +4 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +4 -10
- package/dist/index.mjs.map +1 -1
- package/dist/list-module/src/module/helpers.d.ts +1 -1
- package/dist/list-module/src/module/index.d.ts +1 -1
- package/dist/list-module/src/module/menu/BaseMenu.d.ts +1 -1
- package/dist/list-module/src/module/parse-elem-html.d.ts +1 -1
- package/dist/list-module/src/module/plugin.d.ts +1 -1
- package/dist/list-module/src/module/render-elem.d.ts +1 -1
- package/dist/list-module/src/utils/maps.d.ts +1 -1
- package/dist/plugin-formula/src/constants/icon-svg.d.ts +11 -0
- package/dist/plugin-formula/src/index.d.ts +7 -0
- package/dist/plugin-formula/src/module/custom-types.d.ts +13 -0
- package/dist/plugin-formula/src/module/elem-to-html.d.ts +11 -0
- package/dist/plugin-formula/src/module/index.d.ts +8 -0
- package/dist/plugin-formula/src/module/local.d.ts +5 -0
- package/dist/plugin-formula/src/module/menu/EditFormula.d.ts +29 -0
- package/dist/plugin-formula/src/module/menu/InsertFormula.d.ts +24 -0
- package/dist/plugin-formula/src/module/menu/TextToFormula.d.ts +27 -0
- package/dist/plugin-formula/src/module/menu/index.d.ts +19 -0
- package/dist/plugin-formula/src/module/parse-elem-html.d.ts +12 -0
- package/dist/plugin-formula/src/module/plugin.d.ts +7 -0
- package/dist/plugin-formula/src/module/render-elem.d.ts +12 -0
- package/dist/plugin-formula/src/register-custom-elem/index.d.ts +5 -0
- package/dist/plugin-formula/src/register-custom-elem/native-shim.d.ts +0 -0
- package/dist/plugin-formula/src/utils/dom.d.ts +15 -0
- package/dist/plugin-formula/src/utils/util.d.ts +17 -0
- package/dist/table-module/src/module/column-resize.d.ts +1 -1
- package/dist/table-module/src/module/helpers.d.ts +1 -1
- package/dist/table-module/src/module/index.d.ts +1 -1
- package/dist/table-module/src/module/menu/CellProperty.d.ts +1 -1
- package/dist/table-module/src/module/menu/DeleteCol.d.ts +1 -1
- package/dist/table-module/src/module/menu/DeleteRow.d.ts +1 -1
- package/dist/table-module/src/module/menu/DeleteTable.d.ts +1 -1
- package/dist/table-module/src/module/menu/FullWidth.d.ts +1 -1
- package/dist/table-module/src/module/menu/InsertCol.d.ts +1 -1
- package/dist/table-module/src/module/menu/InsertRow.d.ts +1 -1
- package/dist/table-module/src/module/menu/InsertTable.d.ts +1 -1
- package/dist/table-module/src/module/menu/MergeCell.d.ts +1 -1
- package/dist/table-module/src/module/menu/SplitCell.d.ts +1 -1
- package/dist/table-module/src/module/menu/TableHeader.d.ts +1 -1
- package/dist/table-module/src/module/menu/TableProperty.d.ts +1 -1
- package/dist/table-module/src/module/parse-elem-html.d.ts +1 -1
- package/dist/table-module/src/module/parse-style-html.d.ts +1 -1
- package/dist/table-module/src/module/plugin.d.ts +1 -1
- package/dist/table-module/src/module/render-elem/render-cell.d.ts +1 -1
- package/dist/table-module/src/module/render-elem/render-row.d.ts +1 -1
- package/dist/table-module/src/module/render-elem/render-table.d.ts +1 -1
- package/dist/upload-image-module/src/module/index.d.ts +1 -1
- package/dist/upload-image-module/src/module/menu/UploadImageMenu.d.ts +1 -1
- package/dist/upload-image-module/src/module/menu/config.d.ts +1 -1
- package/dist/upload-image-module/src/module/menu/index.d.ts +1 -1
- package/dist/upload-image-module/src/module/plugin.d.ts +1 -1
- package/dist/upload-image-module/src/module/upload-images.d.ts +1 -1
- package/dist/video-module/src/module/helper/insert-video.d.ts +1 -1
- package/dist/video-module/src/module/helper/upload-videos.d.ts +1 -1
- package/dist/video-module/src/module/index.d.ts +1 -1
- package/dist/video-module/src/module/menu/EditVideoSizeMenu.d.ts +1 -1
- package/dist/video-module/src/module/menu/EditVideoSrcMenu.d.ts +1 -1
- package/dist/video-module/src/module/menu/InsertVideoMenu.d.ts +1 -1
- package/dist/video-module/src/module/menu/UploadVideoMenu.d.ts +1 -1
- package/dist/video-module/src/module/menu/config.d.ts +1 -1
- package/dist/video-module/src/module/menu/index.d.ts +1 -1
- package/dist/video-module/src/module/parse-elem-html.d.ts +1 -1
- package/dist/video-module/src/module/plugin.d.ts +1 -1
- package/dist/video-module/src/module/render-elem.d.ts +1 -1
- package/package.json +8 -8
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description base menu
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IButtonMenu, IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IButtonMenu, IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
declare abstract class BaseMenu implements IButtonMenu {
|
|
7
7
|
readonly type = "list-item";
|
|
8
8
|
abstract readonly ordered: boolean;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description parse elem html
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
import { Descendant } from 'slate';
|
|
7
7
|
import { DOMElement } from '../utils/dom';
|
|
8
8
|
import { ListItemElement } from './custom-types';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description render list elem
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
import { Element as SlateElement } from 'slate';
|
|
7
7
|
import { VNode } from 'snabbdom';
|
|
8
8
|
declare function renderListElem(elemNode: SlateElement, children: VNode[] | null, editor: IDomEditor): VNode;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description icon svg
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 【注意】svg 字符串的长度 ,否则会导致代码体积过大
|
|
7
|
+
* 尽量选择 https://www.iconfont.cn/collections/detail?spm=a313x.7781069.0.da5a778a4&cid=20293
|
|
8
|
+
* 找不到再从 iconfont.com 搜索
|
|
9
|
+
*/
|
|
10
|
+
export declare const SIGMA_SVG = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M941.6 734.72L985.984 640H1024l-64 384H0v-74.24l331.552-391.2L0 227.008V0h980L1024 256h-34.368l-18.72-38.88C935.584 143.744 909.024 128 832 128H169.984l353.056 353.056L225.632 832H768c116 0 146.656-41.568 173.6-97.28z\"></path></svg>";
|
|
11
|
+
export declare const PENCIL_SVG = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z\"></path></svg>";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description elem to html
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { SlateElement } from '@wangeditor-kai/editor';
|
|
6
|
+
declare function formulaToHtml(elem: SlateElement, _childrenHtml: string): string;
|
|
7
|
+
declare const conf: {
|
|
8
|
+
type: string;
|
|
9
|
+
elemToHtml: typeof formulaToHtml;
|
|
10
|
+
};
|
|
11
|
+
export default conf;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description edit formula menu
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor, IModalMenu, SlateNode } from '@wangeditor-kai/editor';
|
|
6
|
+
import { DOMElement } from '../../utils/dom';
|
|
7
|
+
declare class EditFormulaMenu implements IModalMenu {
|
|
8
|
+
readonly title: string;
|
|
9
|
+
readonly iconSvg = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M864 0a160 160 0 0 1 128 256l-64 64-224-224 64-64c26.752-20.096 59.968-32 96-32zM64 736l-64 288 288-64 592-592-224-224L64 736z m651.584-372.416l-448 448-55.168-55.168 448-448 55.168 55.168z\"></path></svg>";
|
|
10
|
+
readonly tag = "button";
|
|
11
|
+
readonly showModal = true;
|
|
12
|
+
readonly modalWidth = 300;
|
|
13
|
+
private $content;
|
|
14
|
+
private readonly textareaId;
|
|
15
|
+
private readonly buttonId;
|
|
16
|
+
private getSelectedElem;
|
|
17
|
+
/**
|
|
18
|
+
* 获取公式 value
|
|
19
|
+
* @param editor editor
|
|
20
|
+
*/
|
|
21
|
+
getValue(editor: IDomEditor): string | boolean;
|
|
22
|
+
isActive(_editor: IDomEditor): boolean;
|
|
23
|
+
exec(_editor: IDomEditor, _value: string | boolean): void;
|
|
24
|
+
isDisabled(editor: IDomEditor): boolean;
|
|
25
|
+
getModalPositionNode(editor: IDomEditor): SlateNode | null;
|
|
26
|
+
getModalContentElem(editor: IDomEditor): DOMElement;
|
|
27
|
+
private updateFormula;
|
|
28
|
+
}
|
|
29
|
+
export default EditFormulaMenu;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description insert formula menu
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor, IModalMenu, SlateNode } from '@wangeditor-kai/editor';
|
|
6
|
+
import { DOMElement } from '../../utils/dom';
|
|
7
|
+
declare class InsertFormulaMenu implements IModalMenu {
|
|
8
|
+
readonly title: string;
|
|
9
|
+
readonly iconSvg = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M941.6 734.72L985.984 640H1024l-64 384H0v-74.24l331.552-391.2L0 227.008V0h980L1024 256h-34.368l-18.72-38.88C935.584 143.744 909.024 128 832 128H169.984l353.056 353.056L225.632 832H768c116 0 146.656-41.568 173.6-97.28z\"></path></svg>";
|
|
10
|
+
readonly tag = "button";
|
|
11
|
+
readonly showModal = true;
|
|
12
|
+
readonly modalWidth = 300;
|
|
13
|
+
private $content;
|
|
14
|
+
private readonly textareaId;
|
|
15
|
+
private readonly buttonId;
|
|
16
|
+
getValue(_editor: IDomEditor): string | boolean;
|
|
17
|
+
isActive(_editor: IDomEditor): boolean;
|
|
18
|
+
exec(_editor: IDomEditor, _value: string | boolean): void;
|
|
19
|
+
isDisabled(editor: IDomEditor): boolean;
|
|
20
|
+
getModalPositionNode(_editor: IDomEditor): SlateNode | null;
|
|
21
|
+
getModalContentElem(editor: IDomEditor): DOMElement;
|
|
22
|
+
private insertFormula;
|
|
23
|
+
}
|
|
24
|
+
export default InsertFormulaMenu;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description text to formula menu - 文本转公式菜单
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor, IModalMenu, SlateNode } from '@wangeditor-kai/editor';
|
|
6
|
+
import { DOMElement } from '../../utils/dom';
|
|
7
|
+
declare class TextToFormulaMenu implements IModalMenu {
|
|
8
|
+
readonly title: string;
|
|
9
|
+
readonly iconSvg = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M941.6 734.72L985.984 640H1024l-64 384H0v-74.24l331.552-391.2L0 227.008V0h980L1024 256h-34.368l-18.72-38.88C935.584 143.744 909.024 128 832 128H169.984l353.056 353.056L225.632 832H768c116 0 146.656-41.568 173.6-97.28z\"></path></svg>";
|
|
10
|
+
readonly tag = "button";
|
|
11
|
+
readonly showModal = true;
|
|
12
|
+
readonly modalWidth = 300;
|
|
13
|
+
private $content;
|
|
14
|
+
private readonly textareaId;
|
|
15
|
+
private readonly buttonId;
|
|
16
|
+
getValue(_editor: IDomEditor): string | boolean;
|
|
17
|
+
isActive(_editor: IDomEditor): boolean;
|
|
18
|
+
exec(_editor: IDomEditor, _value: string | boolean): void;
|
|
19
|
+
/**
|
|
20
|
+
* 检查是否禁用菜单
|
|
21
|
+
*/
|
|
22
|
+
isDisabled(editor: IDomEditor): boolean;
|
|
23
|
+
getModalPositionNode(_editor: IDomEditor): SlateNode | null;
|
|
24
|
+
getModalContentElem(editor: IDomEditor): DOMElement;
|
|
25
|
+
private insertFormula;
|
|
26
|
+
}
|
|
27
|
+
export default TextToFormulaMenu;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description formula menu entry
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import EditFormulaMenu from './EditFormula';
|
|
6
|
+
import InsertFormulaMenu from './InsertFormula';
|
|
7
|
+
import TextToFormulaMenu from './TextToFormula';
|
|
8
|
+
export declare const insertFormulaMenuConf: {
|
|
9
|
+
key: string;
|
|
10
|
+
factory(): InsertFormulaMenu;
|
|
11
|
+
};
|
|
12
|
+
export declare const editFormulaMenuConf: {
|
|
13
|
+
key: string;
|
|
14
|
+
factory(): EditFormulaMenu;
|
|
15
|
+
};
|
|
16
|
+
export declare const textToFormulaMenuConf: {
|
|
17
|
+
key: string;
|
|
18
|
+
factory(): TextToFormulaMenu;
|
|
19
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description parse elem html
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor, SlateDescendant, SlateElement } from '@wangeditor-kai/editor';
|
|
6
|
+
import { DOMElement } from '../utils/dom';
|
|
7
|
+
declare function parseHtml(elem: DOMElement, _children: SlateDescendant[], _editor: IDomEditor): SlateElement;
|
|
8
|
+
declare const parseHtmlConf: {
|
|
9
|
+
selector: string;
|
|
10
|
+
parseElemHtml: typeof parseHtml;
|
|
11
|
+
};
|
|
12
|
+
export default parseHtmlConf;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description render elem
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import { IDomEditor, SlateElement } from '@wangeditor-kai/editor';
|
|
6
|
+
import { VNode } from 'snabbdom';
|
|
7
|
+
declare function renderFormula(elem: SlateElement, children: VNode[] | null, editor: IDomEditor): VNode;
|
|
8
|
+
declare const conf: {
|
|
9
|
+
type: string;
|
|
10
|
+
renderElem: typeof renderFormula;
|
|
11
|
+
};
|
|
12
|
+
export default conf;
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description DOM 操作
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
import $ from 'dom7';
|
|
6
|
+
import DOMNode = globalThis.Node;
|
|
7
|
+
import DOMComment = globalThis.Comment;
|
|
8
|
+
import DOMElement = globalThis.Element;
|
|
9
|
+
import DOMText = globalThis.Text;
|
|
10
|
+
import DOMRange = globalThis.Range;
|
|
11
|
+
import DOMSelection = globalThis.Selection;
|
|
12
|
+
import DOMStaticRange = globalThis.StaticRange;
|
|
13
|
+
export { Dom7Array } from 'dom7';
|
|
14
|
+
export default $;
|
|
15
|
+
export { DOMComment, DOMElement, DOMNode, DOMRange, DOMSelection, DOMStaticRange, DOMText, };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @description 工具函数
|
|
3
|
+
* @author wangfupeng
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 获取随机数字符串
|
|
7
|
+
* @param prefix 前缀
|
|
8
|
+
* @returns 随机数字符串
|
|
9
|
+
*/
|
|
10
|
+
export declare function genRandomStr(prefix?: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* 过滤开头
|
|
13
|
+
*
|
|
14
|
+
*/
|
|
15
|
+
export declare function cleanMathDelimiters(latex: any): any;
|
|
16
|
+
export declare function fixKatexFormula(latex: any): any;
|
|
17
|
+
export declare function composeFnDeal(latex: string): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IButtonMenu, IDomEditor } from '@wangeditor-
|
|
1
|
+
import { IButtonMenu, IDomEditor } from '@wangeditor-kai/core';
|
|
2
2
|
import TableProperty from './TableProperty';
|
|
3
3
|
declare class CellProperty extends TableProperty implements IButtonMenu {
|
|
4
4
|
readonly title: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description del col menu
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IButtonMenu, IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IButtonMenu, IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
declare class DeleteCol implements IButtonMenu {
|
|
7
7
|
readonly title: string;
|
|
8
8
|
readonly iconSvg = "<svg viewBox=\"0 0 1048 1024\"><path d=\"M327.68 510.976L393.216 445.44v-13.1072L327.68 366.7968V510.976z m327.68-78.4384l65.536-65.536V507.904L655.36 442.368v-9.8304z m393.216 484.9664V0H0v917.504h1048.576z m-65.536-131.072h-262.144v-52.4288l-13.1072 13.1072-52.4288-52.4288v91.7504H393.216v-91.7504l-52.4288 52.4288-13.1072-13.1072v52.4288H65.536V65.536H327.68v121.2416l36.0448-36.0448 29.4912 29.4912V62.2592h262.144V180.224l49.152-49.152 16.384 16.384V62.2592h262.144V786.432z m-294.912-108.1344l-160.5632-160.5632-167.1168 167.1168-78.6432-78.6432 167.1168-167.1168L288.3584 278.528l78.6432-78.6432 160.5632 160.5632 163.84-163.84 78.6432 78.6432-163.84 163.84 160.5632 160.5632-78.6432 78.6432z\"></path></svg>";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description del row menu
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IButtonMenu, IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IButtonMenu, IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
declare class DeleteRow implements IButtonMenu {
|
|
7
7
|
readonly title: string;
|
|
8
8
|
readonly iconSvg = "<svg viewBox=\"0 0 1048 1024\"><path d=\"M907.6736 586.5472L747.1104 425.984l163.84-163.84-78.6432-78.6432-163.84 163.84L507.904 186.7776 429.2608 262.144l163.84 163.84-167.1168 167.1168 78.6432 78.6432 167.1168-167.1168 160.5632 160.5632 75.3664-78.6432zM0 917.504V0h1048.576v917.504H0z m983.04-327.68h-22.9376l-65.536-65.536H983.04V327.68h-91.7504l65.536-65.536h26.2144V65.536H65.536v196.608h317.8496l65.536 65.536H65.536v196.608h380.1088l-65.536 65.536H65.536v196.608H983.04v-196.608z\"></path></svg>";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description del table menu
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IButtonMenu, IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IButtonMenu, IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
declare class DeleteTable implements IButtonMenu {
|
|
7
7
|
readonly title: string;
|
|
8
8
|
readonly iconSvg = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M826.8032 356.5312c-19.328 0-36.3776 15.6928-36.3776 35.0464v524.2624c0 19.328-16 34.56-35.328 34.56H264.9344c-19.328 0-35.5072-15.3088-35.5072-34.56V390.0416c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.6928-33.5104 35.0464V915.712c0 57.9328 44.6208 108.288 102.528 108.288H755.2c57.9328 0 108.0832-50.4576 108.0832-108.288V391.4752c-0.1024-19.2512-17.1264-34.944-36.48-34.944z\" p-id=\"9577\"></path><path d=\"M437.1712 775.7568V390.6048c0-19.328-14.1568-35.0464-33.5104-35.0464s-33.5104 15.616-33.5104 35.0464v385.152c0 19.328 14.1568 35.0464 33.5104 35.0464s33.5104-15.7184 33.5104-35.0464zM649.7024 775.7568V390.6048c0-19.328-17.0496-35.0464-36.3776-35.0464s-36.3776 15.616-36.3776 35.0464v385.152c0 19.328 17.0496 35.0464 36.3776 35.0464s36.3776-15.7184 36.3776-35.0464zM965.0432 217.0368h-174.6176V145.5104c0-57.9328-47.2064-101.76-104.6528-101.76h-350.976c-57.8304 0-105.3952 43.8528-105.3952 101.76v71.5264H54.784c-19.4304 0-35.0464 14.1568-35.0464 33.5104 0 19.328 15.616 33.5104 35.0464 33.5104h910.3616c19.328 0 35.0464-14.1568 35.0464-33.5104 0-19.3536-15.6928-33.5104-35.1488-33.5104z m-247.3728 0H297.3952V145.5104c0-19.328 18.2016-34.7648 37.4272-34.7648h350.976c19.1488 0 31.872 15.1296 31.872 34.7648v71.5264z\"></path></svg>";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description table full width menu
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IButtonMenu, IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IButtonMenu, IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
declare class TableFullWidth implements IButtonMenu {
|
|
7
7
|
readonly title: string;
|
|
8
8
|
readonly iconSvg = "<svg viewBox=\"0 0 1228 1024\"><path d=\"M862.514337 563.200461H404.581995v121.753478a13.311987 13.311987 0 0 1-6.655993 11.468789 10.23999 10.23999 0 0 1-12.083188-1.433599l-204.799795-179.199821a13.721586 13.721586 0 0 1 0-20.479979l204.799795-179.302221a10.23999 10.23999 0 0 1 12.185588-1.535998 13.209587 13.209587 0 0 1 6.553593 11.673588v115.097485h457.932342V319.693504a11.571188 11.571188 0 0 1 18.841582-10.239989l204.799795 179.19982a13.721586 13.721586 0 0 1 0 20.47998l-204.799795 179.199821a10.23999 10.23999 0 0 1-12.185588 1.535998 13.311987 13.311987 0 0 1-6.655994-11.571188V563.200461zM136.499064 14.951409v993.893406a15.257585 15.257585 0 0 1-15.155185 15.052785H15.155185A15.155185 15.155185 0 0 1 0 1008.844815V14.951409a15.257585 15.257585 0 0 1 15.155185-15.052785h106.086294a15.155185 15.155185 0 0 1 15.257585 15.155185zM1228.798771 14.951409v993.893406a15.257585 15.257585 0 0 1-15.155185 15.052785h-106.188693a15.155185 15.155185 0 0 1-15.155185-15.052785V14.951409a15.257585 15.257585 0 0 1 15.155185-15.052785h106.086293A15.155185 15.155185 0 0 1 1228.798771 15.053809z\"></path></svg>";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description insert col menu
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IButtonMenu, IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IButtonMenu, IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
declare class InsertCol implements IButtonMenu {
|
|
7
7
|
readonly title: string;
|
|
8
8
|
readonly iconSvg = "<svg viewBox=\"0 0 1048 1024\"><path d=\"M327.68 193.3312v186.7776H140.9024v91.7504H327.68v186.7776h88.4736V471.8592h190.0544V380.1088H416.1536V193.3312zM0 917.504V0h1048.576v917.504H0zM655.36 65.536H65.536v720.896H655.36V65.536z m327.68 0h-262.144v196.608h262.144V65.536z m0 262.144h-262.144v196.608h262.144V327.68z m0 262.144h-262.144v196.608h262.144v-196.608z\"></path></svg>";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description insert row menu
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IButtonMenu, IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IButtonMenu, IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
declare class InsertRow implements IButtonMenu {
|
|
7
7
|
readonly title: string;
|
|
8
8
|
readonly iconSvg = "<svg viewBox=\"0 0 1048 1024\"><path d=\"M707.7888 521.0112h-147.456v-147.456H488.2432v147.456h-147.456v68.8128h147.456v147.456h72.0896v-147.456h147.456zM0 917.504V0h1048.576v917.504H0zM327.68 65.536H65.536v196.608H327.68V65.536z m327.68 0H393.216v196.608h262.144V65.536z m327.68 0h-262.144v196.608h262.144V65.536z m0 258.8672H65.536v462.0288H983.04V324.4032z\"></path></svg>";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description insert table menu
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IDomEditor, IDropPanelMenu } from '@wangeditor-
|
|
5
|
+
import { IDomEditor, IDropPanelMenu } from '@wangeditor-kai/core';
|
|
6
6
|
import { DOMElement } from '../../utils/dom';
|
|
7
7
|
declare class InsertTable implements IDropPanelMenu {
|
|
8
8
|
title: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description table header menu
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IButtonMenu, IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IButtonMenu, IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
declare class TableHeader implements IButtonMenu {
|
|
7
7
|
readonly title: string;
|
|
8
8
|
readonly iconSvg = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M704 128l-64 0L384 128 320 128 0 128l0 256 0 64 0 192 0 64 0 256 320 0 64 0 256 0 64 0 320 0 0-256 0-64L1024 448 1024 384 1024 128 704 128zM640 640 384 640 384 448l256 0L640 640zM64 448l256 0 0 192L64 640 64 448zM320 896 64 896l0-192 256 0L320 896zM640 896 384 896l0-192 256 0L640 896zM960 896l-256 0 0-192 256 0L960 896zM960 640l-256 0L704 448l256 0L960 640z\"></path></svg>";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description set cell property menu
|
|
3
3
|
* @author hsuna
|
|
4
4
|
*/
|
|
5
|
-
import { IButtonMenu, IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IButtonMenu, IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
declare class TableProperty implements IButtonMenu {
|
|
7
7
|
readonly title: string;
|
|
8
8
|
iconSvg: string;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description parse html
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
import { Descendant } from 'slate';
|
|
7
7
|
import { DOMElement } from '../utils/dom';
|
|
8
8
|
import { TableCellElement, TableElement, TableRowElement } from './custom-types';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description parse style html
|
|
3
3
|
* @author hsuna
|
|
4
4
|
*/
|
|
5
|
-
import { IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
import { Descendant } from 'slate';
|
|
7
7
|
import { DOMElement } from '../utils/dom';
|
|
8
8
|
export declare function parseStyleHtml(elem: DOMElement, node: Descendant, _editor: IDomEditor): Descendant;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description render cell
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
import { Element as SlateElement } from 'slate';
|
|
7
7
|
import { VNode } from 'snabbdom';
|
|
8
8
|
declare function renderTableCell(cellNode: SlateElement, children: VNode[] | null, editor: IDomEditor): VNode;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description render row
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
import { Element as SlateElement } from 'slate';
|
|
7
7
|
import { VNode } from 'snabbdom';
|
|
8
8
|
declare function renderTableRow(_elemNode: SlateElement, children: VNode[] | null, _editor: IDomEditor): VNode;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description render table
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
import { Element as SlateElement } from 'slate';
|
|
7
7
|
import { VNode } from 'snabbdom';
|
|
8
8
|
declare function renderTable(elemNode: SlateElement, children: VNode[] | null, editor: IDomEditor): VNode;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description upload image menu
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IButtonMenu, IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IButtonMenu, IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
declare class UploadImage implements IButtonMenu {
|
|
7
7
|
readonly title: string;
|
|
8
8
|
readonly iconSvg = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M828.708571 585.045333a48.761905 48.761905 0 0 0-48.737523 48.761905v18.529524l-72.143238-72.167619a135.972571 135.972571 0 0 0-191.585524 0l-34.133334 34.133333-120.880762-120.953905a138.898286 138.898286 0 0 0-191.585523 0l-72.167619 72.167619V292.400762a48.786286 48.786286 0 0 1 48.761904-48.761905h341.23581a48.737524 48.737524 0 0 0 34.474667-83.285333 48.737524 48.737524 0 0 0-34.474667-14.287238H146.236952A146.212571 146.212571 0 0 0 0 292.400762v585.289143A146.358857 146.358857 0 0 0 146.236952 1024h584.996572a146.212571 146.212571 0 0 0 146.236952-146.310095V633.807238a48.786286 48.786286 0 0 0-48.761905-48.761905zM146.261333 926.45181a48.737524 48.737524 0 0 1-48.761904-48.761905v-174.128762l141.409523-141.458286a38.497524 38.497524 0 0 1 53.126096 0l154.526476 154.624 209.627428 209.724953H146.236952z m633.734096-48.761905c-0.073143 9.337905-3.145143 18.383238-8.777143 25.843809l-219.843048-220.94019 34.133333-34.133334a37.546667 37.546667 0 0 1 53.613715 0l140.873143 141.897143V877.714286zM1009.615238 160.231619L863.329524 13.897143a48.737524 48.737524 0 0 0-16.091429-10.24c-11.849143-4.87619-25.161143-4.87619-37.059047 0a48.761905 48.761905 0 0 0-16.067048 10.24l-146.236952 146.334476a49.005714 49.005714 0 0 0 69.217523 69.241905l62.902858-63.390476v272.627809a48.761905 48.761905 0 1 0 97.475047 0V166.083048l62.902857 63.390476a48.737524 48.737524 0 0 0 69.217524 0 48.761905 48.761905 0 0 0 0-69.241905z\"></path></svg>";
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
* @description editor 插件,重写 editor API
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IDomEditor } from '@wangeditor-
|
|
5
|
+
import { IDomEditor } from '@wangeditor-kai/core';
|
|
6
6
|
declare function withUploadImage<T extends IDomEditor>(editor: T): T;
|
|
7
7
|
export default withUploadImage;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @description 修改视频尺寸
|
|
3
3
|
* @author wangfupeng
|
|
4
4
|
*/
|
|
5
|
-
import { IDomEditor, IModalMenu } from '@wangeditor-
|
|
5
|
+
import { IDomEditor, IModalMenu } from '@wangeditor-kai/core';
|
|
6
6
|
import { Node as SlateNode } from 'slate';
|
|
7
7
|
import { DOMElement } from '../../utils/dom';
|
|
8
8
|
declare class EditorVideoSizeMenu implements IModalMenu {
|