@wangeditor-kai/editor 5.6.54 → 5.6.55-kai.10

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.
Files changed (56) hide show
  1. package/dist/basic-modules/src/modules/link/parse-elem-html.d.ts +1 -1
  2. package/dist/core/src/config/interface.d.ts +23 -11
  3. package/dist/core/src/editor/dom-editor.d.ts +1 -0
  4. package/dist/core/src/editor/interface.d.ts +4 -1
  5. package/dist/core/src/index.d.ts +6 -6
  6. package/dist/core/src/menus/index.d.ts +2 -2
  7. package/dist/core/src/render/text/renderText.d.ts +1 -1
  8. package/dist/core/src/text-area/TextArea.d.ts +5 -0
  9. package/dist/core/src/text-area/helpers.d.ts +7 -3
  10. package/dist/core/src/upload/index.d.ts +3 -2
  11. package/dist/core/src/upload/interface.d.ts +4 -3
  12. package/dist/core/src/utils/sanitize-html.d.ts +5 -0
  13. package/dist/core/src/utils/weak-maps.d.ts +2 -0
  14. package/dist/css/style.css +6 -13
  15. package/dist/editor/src/Boot.d.ts +3 -2
  16. package/dist/editor/src/create.d.ts +3 -2
  17. package/dist/editor/src/index.d.ts +4 -3
  18. package/dist/editor/src/register-builtin-modules/index.d.ts +0 -6
  19. package/dist/editor/src/register-builtin-modules/register.d.ts +1 -1
  20. package/dist/index.js +3 -16
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.mjs +3 -15
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/plugin-formula/src/constants/icon-svg.d.ts +11 -0
  25. package/dist/plugin-formula/src/index.d.ts +7 -0
  26. package/dist/plugin-formula/src/module/custom-types.d.ts +13 -0
  27. package/dist/plugin-formula/src/module/elem-to-html.d.ts +11 -0
  28. package/dist/plugin-formula/src/module/index.d.ts +8 -0
  29. package/dist/plugin-formula/src/module/local.d.ts +5 -0
  30. package/dist/plugin-formula/src/module/menu/EditFormula.d.ts +29 -0
  31. package/dist/plugin-formula/src/module/menu/InsertFormula.d.ts +24 -0
  32. package/dist/plugin-formula/src/module/menu/TextToFormula.d.ts +27 -0
  33. package/dist/plugin-formula/src/module/menu/index.d.ts +19 -0
  34. package/dist/plugin-formula/src/module/parse-elem-html.d.ts +12 -0
  35. package/dist/plugin-formula/src/module/plugin.d.ts +7 -0
  36. package/dist/plugin-formula/src/module/render-elem.d.ts +12 -0
  37. package/dist/plugin-formula/src/register-custom-elem/index.d.ts +5 -0
  38. package/dist/plugin-formula/src/register-custom-elem/native-shim.d.ts +0 -0
  39. package/dist/plugin-formula/src/utils/dom.d.ts +15 -0
  40. package/dist/plugin-formula/src/utils/util.d.ts +16 -0
  41. package/dist/table-module/src/constants/svg.d.ts +1 -0
  42. package/dist/table-module/src/locale/en.d.ts +1 -0
  43. package/dist/table-module/src/locale/zh-CN.d.ts +1 -0
  44. package/dist/table-module/src/module/custom-types.d.ts +5 -0
  45. package/dist/table-module/src/module/helpers.d.ts +16 -0
  46. package/dist/table-module/src/module/menu/FullWidth.d.ts +3 -3
  47. package/dist/table-module/src/module/menu/TableColumn.d.ts +15 -0
  48. package/dist/table-module/src/module/menu/TableHeaderMenu.d.ts +19 -0
  49. package/dist/table-module/src/module/menu/index.d.ts +5 -0
  50. package/dist/table-module/src/module/menu/table-colors.d.ts +5 -0
  51. package/dist/table-module/src/module/parse-elem-html.d.ts +1 -1
  52. package/dist/table-module/src/module/pre-parse-html.d.ts +1 -1
  53. package/dist/table-module/src/module/render-elem/render-row.d.ts +1 -1
  54. package/dist/table-module/src/module/row-resize.d.ts +15 -0
  55. package/dist/table-module/src/module/table-cursor.d.ts +1 -0
  56. package/package.json +19 -15
@@ -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,16 @@
1
+ /**
2
+ * @description 工具函数
3
+ * @author wangfupeng
4
+ */
5
+ /**
6
+ * 获取随机数字符串
7
+ * @param prefix 前缀
8
+ * @returns 随机数字符串
9
+ */
10
+ export declare function genRandomStr(prefix?: string): string;
11
+ export declare function fixKatexFormula(latex: any): any;
12
+ /**
13
+ * 清理公式包裹符号
14
+ */
15
+ export declare function cleanMathDelimiters(latex: any): any;
16
+ export declare function composeFnDeal(latex: string): string;
@@ -14,6 +14,7 @@ export declare const DEL_ROW_SVG = "<svg viewBox=\"0 0 1048 1024\"><path d=\"M90
14
14
  export declare const ADD_COL_SVG = "<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>";
15
15
  export declare const DEL_COL_SVG = "<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>";
16
16
  export declare const TABLE_HEADER_SVG = "<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>";
17
+ export declare const TABLE_COLUMN_SVG = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M128 0h256v320H128V0z m0 384h256v256H128V384z m0 320h256v320H128V704z m320-576h64v320h-64V128z m0 384h64v256h-64V512z m0 320h64v192h-64V832z m128-704h64v320h-64V128z m0 384h64v256h-64V512z m0 320h64v192h-64V832z m128-704h320v320H704V128z m0 384h320v256H704V512z m0 320h320v192H704V832z\"></path></svg>";
17
18
  export declare const FULL_WIDTH_SVG = "<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>";
18
19
  export declare const MERGE_CELL_SVG = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M482.2 508.4 331.3 389c-3-2.4-7.3-.2-7.3 3.6V478H184V184h204v128c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V144c0-15.5-12.5-28-28-28H144c-15.5 0-28 12.5-28 28v736c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v128H184V546h140v85.4c0 3.8 4.4 6 7.3 3.6l150.9-119.4c2.4-1.8 2.4-5.4 0-7.2zM880 116H596c-15.5 0-28 12.5-28 28v168c0 2.2 1.8 4 4 4h60c2.2 0 4-1.8 4-4V184h204v294H700v-85.4c0-3.8-4.3-6-7.3-3.6l-151 119.4c-2.3 1.8-2.3 5.3 0 7.1l151 119.5c2.9 2.3 7.3.2 7.3-3.6V546h140v294H636V712c0-2.2-1.8-4-4-4h-60c-2.2 0-4 1.8-4 4v168c0 15.5 12.5 28 28 28h284c15.5 0 28-12.5 28-28V144c0-15.5-12.5-28-28-28z\"/></svg>";
19
20
  export declare const SPLIT_CELL_SVG = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M362.667 494.933v53.334l25.6-25.6zm0-241.066L460.8 352V78.933H57.6v98.134h305.067zm0 535.466v57.6H57.6v98.134h403.2V691.2zM661.333 494.933v53.334l-25.6-25.6zm0-241.066L563.2 352V78.933h403.2v98.134H661.333zm0 535.466v57.6H966.4v98.134H563.2V691.2z\"/><path d=\"M753.067 341.333 693.333 281.6 512 460.8 330.667 281.6l-59.734 59.733 181.334 181.334L270.933 704l59.734 59.733L512 582.4l181.333 181.333L753.067 704 571.733 522.667z\"/></svg>";
@@ -34,6 +34,7 @@ declare const _default: {
34
34
  insertRow: string;
35
35
  insertTable: string;
36
36
  header: string;
37
+ column: string;
37
38
  mergeCell: string;
38
39
  splitCell: string;
39
40
  tableProperty: string;
@@ -34,6 +34,7 @@ declare const _default: {
34
34
  insertRow: string;
35
35
  insertTable: string;
36
36
  header: string;
37
+ column: string;
37
38
  mergeCell: string;
38
39
  splitCell: string;
39
40
  tableProperty: string;
@@ -24,6 +24,7 @@ export type TableCellElement = {
24
24
  export type TableRowElement = {
25
25
  type: 'table-row';
26
26
  children: TableCellElement[];
27
+ height?: number;
27
28
  };
28
29
  export type TableElement = {
29
30
  type: 'table';
@@ -36,4 +37,8 @@ export type TableElement = {
36
37
  isResizing?: boolean | null;
37
38
  isHoverCellBorder?: boolean;
38
39
  columnWidths?: number[];
40
+ /** row resize */
41
+ resizingRowIndex?: number;
42
+ isResizingRow?: boolean | null;
43
+ isHoverRowBorder?: boolean;
39
44
  };
@@ -20,3 +20,19 @@ export declare function isTableWithHeader(tableNode: TableElement): boolean;
20
20
  * @param cellNode cell node
21
21
  */
22
22
  export declare function isCellInFirstRow(editor: IDomEditor, cellNode: TableCellElement): boolean;
23
+ /**
24
+ * 获取第一列所有 cells
25
+ * @param tableNode table node
26
+ */
27
+ export declare function getFirstColCells(tableNode: TableElement): TableCellElement[];
28
+ /**
29
+ * 表格是否带有标题列?
30
+ * @param tableNode table node
31
+ */
32
+ export declare function isTableWithColumn(tableNode: TableElement): boolean;
33
+ /**
34
+ * 单元格是否在第一列
35
+ * @param editor editor
36
+ * @param cellNode cell node
37
+ */
38
+ export declare function isCellInFirstCol(editor: IDomEditor, cellNode: TableCellElement): boolean;
@@ -7,9 +7,9 @@ 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>";
9
9
  readonly tag = "button";
10
- getValue(editor: IDomEditor): string | boolean;
11
- isActive(editor: IDomEditor): boolean;
10
+ getValue(_editor: IDomEditor): string | boolean;
11
+ isActive(_editor: IDomEditor): boolean;
12
12
  isDisabled(editor: IDomEditor): boolean;
13
- exec(editor: IDomEditor, value: string | boolean): void;
13
+ exec(editor: IDomEditor, _value: string | boolean): void;
14
14
  }
15
15
  export default TableFullWidth;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @description table column menu
3
+ * @author hsuna
4
+ */
5
+ import { IButtonMenu, IDomEditor } from '@wangeditor-kai/core';
6
+ declare class TableColumn implements IButtonMenu {
7
+ readonly title: string;
8
+ readonly iconSvg = "<svg viewBox=\"0 0 1024 1024\"><path d=\"M128 0h256v320H128V0z m0 384h256v256H128V384z m0 320h256v320H128V704z m320-576h64v320h-64V128z m0 384h64v256h-64V512z m0 320h64v192h-64V832z m128-704h64v320h-64V128z m0 384h64v256h-64V512z m0 320h64v192h-64V832z m128-704h320v320H704V128z m0 384h320v256H704V512z m0 320h320v192H704V832z\"></path></svg>";
9
+ readonly tag = "button";
10
+ getValue(editor: IDomEditor): string | boolean;
11
+ isActive(editor: IDomEditor): boolean;
12
+ isDisabled(editor: IDomEditor): boolean;
13
+ exec(editor: IDomEditor, value: string | boolean): void;
14
+ }
15
+ export default TableColumn;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @description table header row/col dropdown panel menu
3
+ */
4
+ import { IDomEditor, IDropPanelMenu } from '@wangeditor-kai/core';
5
+ import { DOMElement } from '../../utils/dom';
6
+ declare class TableHeaderMenu implements IDropPanelMenu {
7
+ readonly title: string;
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>";
9
+ readonly tag = "button";
10
+ readonly showDropPanel = true;
11
+ getValue(_editor: IDomEditor): string | boolean;
12
+ isActive(_editor: IDomEditor): boolean;
13
+ isDisabled(editor: IDomEditor): boolean;
14
+ exec(_editor: IDomEditor, _value: string | boolean): void;
15
+ getPanelContentElem(editor: IDomEditor): DOMElement;
16
+ private _toggleHeaderRow;
17
+ private _toggleHeaderCol;
18
+ }
19
+ export default TableHeaderMenu;
@@ -13,6 +13,7 @@ import InsertTable from './InsertTable';
13
13
  import MergeCell from './MergeCell';
14
14
  import SplitCell from './SplitCell';
15
15
  import TableHander from './TableHeader';
16
+ import TableColumn from './TableColumn';
16
17
  import TableProperty from './TableProperty';
17
18
  export declare const insertTableMenuConf: {
18
19
  key: string;
@@ -42,6 +43,10 @@ export declare const tableHeaderMenuConf: {
42
43
  key: string;
43
44
  factory(): TableHander;
44
45
  };
46
+ export declare const tableColumnMenuConf: {
47
+ key: string;
48
+ factory(): TableColumn;
49
+ };
45
50
  export declare const tableFullWidthMenuConf: {
46
51
  key: string;
47
52
  factory(): FullWidth;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @description table background colors config
3
+ * @author hsuna
4
+ */
5
+ export declare function genTableBgColors(): string[];
@@ -11,7 +11,7 @@ export declare const parseCellHtmlConf: {
11
11
  selector: string;
12
12
  parseElemHtml: typeof parseCellHtml;
13
13
  };
14
- declare function parseRowHtml(_elem: DOMElement, children: Descendant[], _editor: IDomEditor): TableRowElement;
14
+ declare function parseRowHtml(elem: DOMElement, children: Descendant[], _editor: IDomEditor): TableRowElement;
15
15
  export declare const parseRowHtmlConf: {
16
16
  selector: string;
17
17
  parseElemHtml: typeof parseRowHtml;
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import { DOMElement } from '../utils/dom';
6
6
  /**
7
- * pre-prase table ,去掉 <tbody> 和处理单元格中的 <p> 标签,以及删除隐藏的单元格
7
+ * pre-prase table ,去掉 <tbody> 和处理单元格中的 <p> 标签
8
8
  * @param table table elem
9
9
  */
10
10
  declare function preParse(tableElem: DOMElement): DOMElement;
@@ -5,5 +5,5 @@
5
5
  import { IDomEditor } from '@wangeditor-kai/core';
6
6
  import { Element as SlateElement } from 'slate';
7
7
  import { VNode } from 'snabbdom';
8
- declare function renderTableRow(_elemNode: SlateElement, children: VNode[] | null, _editor: IDomEditor): VNode;
8
+ declare function renderTableRow(elemNode: SlateElement, children: VNode[] | null, _editor: IDomEditor): VNode;
9
9
  export default renderTableRow;
@@ -0,0 +1,15 @@
1
+ import { IDomEditor } from '@wangeditor-kai/core';
2
+ import { Element as SlateElement } from 'slate';
3
+ /**
4
+ * 计算行高度的比例
5
+ */
6
+ export declare function getRowHeightRatios(rowHeights: number[]): number[];
7
+ /**
8
+ * 鼠标移动时,判断在哪个行边界上
9
+ */
10
+ export declare function handleRowBorderVisible(editor: IDomEditor, elemNode: SlateElement, e: MouseEvent): void;
11
+ /**
12
+ * 设置行拖拽高亮
13
+ */
14
+ export declare function handleRowBorderHighlight(editor: IDomEditor, e: MouseEvent): void;
15
+ export declare function handleRowBorderMouseDown(editor: IDomEditor, _elemNode: SlateElement): void;
@@ -16,4 +16,5 @@ export declare const TableCursor: {
16
16
  * @returns {boolean} - Returns true if the cell is selected, otherwise false.
17
17
  */
18
18
  isSelected<T extends Element>(editor: Editor, element: T): boolean;
19
+ hasSelected(editor: Editor): boolean;
19
20
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@wangeditor-kai/editor",
3
- "version": "5.6.54",
4
- "description": "Web rich text editor, Web 富文本编辑器 仅个人修改使用",
3
+ "version": "5.6.55-kai.10",
4
+ "description": "Web rich text editor, Web 富文本编辑器",
5
5
  "keywords": [
6
6
  "wangeditor",
7
7
  "rich text",
@@ -40,8 +40,8 @@
40
40
  "url": "git+https://github.com/wangeditor-next/wangEditor-next.git"
41
41
  },
42
42
  "scripts": {
43
- "test": "jest",
44
- "test-c": "jest --coverage",
43
+ "test": "vitest run",
44
+ "test-c": "vitest run --coverage",
45
45
  "example": "concurrently \"pnpm dev-watch\" \"http-server -p 8881 -c-1\" ",
46
46
  "dev": "cross-env NODE_ENV=development rollup -c rollup.config.js",
47
47
  "dev-watch": "cross-env NODE_ENV=development rollup -c rollup.config.js -w",
@@ -55,14 +55,14 @@
55
55
  "dependencies": {
56
56
  "@uppy/core": "^2.1.1",
57
57
  "@uppy/xhr-upload": "^2.0.3",
58
- "@wangeditor-kai/basic-modules": "^1.5.39",
59
- "@wangeditor-kai/code-highlight": "^1.3.36",
60
- "@wangeditor-kai/core": "^1.7.41",
61
- "@wangeditor-kai/list-module": "^1.1.45",
62
- "@wangeditor-kai/plugin-formula": "1.0.38",
63
- "@wangeditor-kai/table-module": "^1.6.50",
64
- "@wangeditor-kai/upload-image-module": "^1.1.42",
65
- "@wangeditor-kai/video-module": "^1.3.45",
58
+ "@wangeditor-kai/basic-modules": "1.5.52-kai.1",
59
+ "@wangeditor-kai/code-highlight": "1.3.48-kai.1",
60
+ "@wangeditor-kai/core": "1.7.50-kai.4",
61
+ "@wangeditor-kai/list-module": "1.1.57-kai.1",
62
+ "@wangeditor-kai/plugin-formula": "1.0.41-kai.1",
63
+ "@wangeditor-kai/table-module": "1.6.66-kai.6",
64
+ "@wangeditor-kai/upload-image-module": "1.1.55-kai.1",
65
+ "@wangeditor-kai/video-module": "1.3.56-kai.1",
66
66
  "dom7": "^4.0.0",
67
67
  "is-hotkey": "^0.2.0",
68
68
  "katex": "^0.16.4",
@@ -70,11 +70,15 @@
70
70
  "lodash.clonedeep": "^4.5.0",
71
71
  "lodash.debounce": "^4.0.8",
72
72
  "lodash.foreach": "^4.5.0",
73
- "lodash.isequal": "^4.5.0",
74
73
  "lodash.throttle": "^4.1.1",
75
74
  "lodash.toarray": "^4.4.0",
76
75
  "nanoid": "^5.0.0",
77
- "slate": "^0.82.0",
76
+ "slate": "^0.123.0",
78
77
  "snabbdom": "^3.6.0"
78
+ },
79
+ "devDependencies": {
80
+ "@wangeditor-kai-shared/rollup-config": "workspace:^",
81
+ "postcss-merge-rules": "^7.0.6",
82
+ "postcss-discard-duplicates": "^7.0.1"
79
83
  }
80
- }
84
+ }