@wangeditor-kai/editor 5.6.55 → 5.6.56

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.
@@ -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,7 @@
1
+ /**
2
+ * @description src entry
3
+ * @author wangfupeng
4
+ */
5
+ import './register-custom-elem';
6
+ import module from './module/index';
7
+ export default module;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @description formula element
3
+ * @author wangfupeng
4
+ */
5
+ type EmptyText = {
6
+ text: '';
7
+ };
8
+ export type FormulaElement = {
9
+ type: 'formula';
10
+ value: string;
11
+ children: EmptyText[];
12
+ };
13
+ export {};
@@ -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,8 @@
1
+ /**
2
+ * @description formula module entry
3
+ * @author wangfupeng
4
+ */
5
+ import './local';
6
+ import { IModuleConf } from '@wangeditor-kai/editor';
7
+ declare const module: Partial<IModuleConf>;
8
+ export default module;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @description 多语言
3
+ * @author wangfupeng
4
+ */
5
+ export {};
@@ -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,7 @@
1
+ /**
2
+ * @description formula plugin
3
+ * @author wangfupeng
4
+ */
5
+ import { IDomEditor } from '@wangeditor-kai/editor';
6
+ declare function withFormula<T extends IDomEditor>(editor: T): T;
7
+ export default withFormula;
@@ -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;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @description 注册自定义 elem
3
+ * @author wangfupeng
4
+ */
5
+ import './native-shim';
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wangeditor-kai/editor",
3
- "version": "5.6.55",
3
+ "version": "5.6.56",
4
4
  "description": "Web rich text editor, Web 富文本编辑器 仅个人修改使用",
5
5
  "keywords": [
6
6
  "wangeditor",
@@ -59,7 +59,7 @@
59
59
  "@wangeditor-kai/code-highlight": "^1.3.36",
60
60
  "@wangeditor-kai/core": "^1.7.41",
61
61
  "@wangeditor-kai/list-module": "^1.1.45",
62
- "@wangeditor-kai/plugin-formula": "1.0.39",
62
+ "@wangeditor-kai/plugin-formula": "1.0.40",
63
63
  "@wangeditor-kai/table-module": "^1.6.50",
64
64
  "@wangeditor-kai/upload-image-module": "^1.1.42",
65
65
  "@wangeditor-kai/video-module": "^1.3.45",