@hufe921/canvas-editor 0.9.44 → 0.9.46
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/CHANGELOG.md +37 -0
- package/dist/canvas-editor.es.js +367 -34
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +31 -31
- package/dist/canvas-editor.umd.js.map +1 -1
- package/dist/src/editor/core/command/Command.d.ts +7 -0
- package/dist/src/editor/core/command/CommandAdapt.d.ts +7 -0
- package/dist/src/editor/core/draw/Draw.d.ts +3 -0
- package/dist/src/editor/core/draw/frame/Background.d.ts +1 -1
- package/dist/src/editor/core/draw/interactive/Group.d.ts +18 -0
- package/dist/src/editor/core/i18n/I18n.d.ts +1 -0
- package/dist/src/editor/core/range/RangeManager.d.ts +1 -1
- package/dist/src/editor/core/worker/WorkerManager.d.ts +2 -0
- package/dist/src/editor/core/worker/works/group.d.ts +1 -0
- package/dist/src/editor/dataset/constant/Common.d.ts +1 -0
- package/dist/src/editor/dataset/constant/Group.d.ts +2 -0
- package/dist/src/editor/dataset/constant/Regular.d.ts +3 -0
- package/dist/src/editor/dataset/enum/Editor.d.ts +2 -1
- package/dist/src/editor/interface/Draw.d.ts +1 -0
- package/dist/src/editor/interface/Editor.d.ts +2 -0
- package/dist/src/editor/interface/Element.d.ts +4 -1
- package/dist/src/editor/interface/Group.d.ts +7 -0
- package/dist/src/editor/interface/Listener.d.ts +1 -0
- package/dist/src/editor/interface/contextmenu/ContextMenu.d.ts +2 -0
- package/dist/src/editor/utils/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/canvas-editor.es.js
CHANGED
|
@@ -23,7 +23,7 @@ var __publicField = (obj, key, value) => {
|
|
|
23
23
|
return value;
|
|
24
24
|
};
|
|
25
25
|
var index = "";
|
|
26
|
-
const version = "0.9.
|
|
26
|
+
const version = "0.9.46";
|
|
27
27
|
var MaxHeightRatio;
|
|
28
28
|
(function(MaxHeightRatio2) {
|
|
29
29
|
MaxHeightRatio2["HALF"] = "half";
|
|
@@ -38,6 +38,7 @@ var NumberType;
|
|
|
38
38
|
const ZERO = "\u200B";
|
|
39
39
|
const WRAP = "\n";
|
|
40
40
|
const NBSP = " ";
|
|
41
|
+
const NON_BREAKING_SPACE = " ";
|
|
41
42
|
const PUNCTUATION_LIST = [
|
|
42
43
|
"\xB7",
|
|
43
44
|
"\u3001",
|
|
@@ -66,6 +67,12 @@ var RowFlex;
|
|
|
66
67
|
RowFlex2["RIGHT"] = "right";
|
|
67
68
|
RowFlex2["ALIGNMENT"] = "alignment";
|
|
68
69
|
})(RowFlex || (RowFlex = {}));
|
|
70
|
+
const LETTER_REG = /[a-zA-Z]/;
|
|
71
|
+
const NUMBER_LIKE_REG = /[0-9.]/;
|
|
72
|
+
const WORD_LIKE_REG = /[^a-zA-Z][a-zA-Z]/;
|
|
73
|
+
const SURROGATE_PAIR_REG = /[\uD800-\uDBFF][\uDC00-\uDFFF]/;
|
|
74
|
+
const EMOJI_REG = /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26D3\uFE0F?(?:\u200D\uD83D\uDCA5)?|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF43\uDF45-\uDF4A\uDF4C-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDE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\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4\uDEB5](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE41\uDE43\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC26(?:\u200D(?:\u2B1B|\uD83D\uDD25))?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?|\uDE42(?:\u200D[\u2194\u2195]\uFE0F?)?|\uDEB6(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDCE(?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D(?:[\u2640\u2642]\uFE0F?(?:\u200D\u27A1\uFE0F?)?|\u27A1\uFE0F?))?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1|\uDDD1\u200D\uD83E\uDDD2(?:\u200D\uD83E\uDDD2)?|\uDDD2(?:\u200D\uD83E\uDDD2)?))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF\uDDBC\uDDBD](?:\u200D\u27A1\uFE0F?)?|[\uDDB0-\uDDB3]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;
|
|
75
|
+
const UNICODE_SYMBOL_REG = new RegExp(`${EMOJI_REG.source}|${SURROGATE_PAIR_REG.source}`, "g");
|
|
69
76
|
function debounce(func, delay) {
|
|
70
77
|
let timer;
|
|
71
78
|
return function(...args) {
|
|
@@ -114,8 +121,20 @@ function getUUID() {
|
|
|
114
121
|
}
|
|
115
122
|
function splitText(text) {
|
|
116
123
|
const data2 = [];
|
|
117
|
-
|
|
118
|
-
|
|
124
|
+
const symbolMap = new Map();
|
|
125
|
+
for (const match of text.matchAll(UNICODE_SYMBOL_REG)) {
|
|
126
|
+
symbolMap.set(match.index, match[0]);
|
|
127
|
+
}
|
|
128
|
+
let t = 0;
|
|
129
|
+
while (t < text.length) {
|
|
130
|
+
const symbol = symbolMap.get(t);
|
|
131
|
+
if (symbol) {
|
|
132
|
+
data2.push(symbol);
|
|
133
|
+
t += symbol.length;
|
|
134
|
+
} else {
|
|
135
|
+
data2.push(text[t]);
|
|
136
|
+
t++;
|
|
137
|
+
}
|
|
119
138
|
}
|
|
120
139
|
return data2;
|
|
121
140
|
}
|
|
@@ -256,6 +275,12 @@ function findScrollContainer(element) {
|
|
|
256
275
|
}
|
|
257
276
|
return document.documentElement;
|
|
258
277
|
}
|
|
278
|
+
function isArrayEqual(arr1, arr2) {
|
|
279
|
+
if (arr1.length !== arr2.length) {
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
return !arr1.some((item) => !arr2.includes(item));
|
|
283
|
+
}
|
|
259
284
|
const CURSOR_AGENT_HEIGHT = 12;
|
|
260
285
|
const defaultCursorOption = {
|
|
261
286
|
width: 1,
|
|
@@ -315,7 +340,8 @@ const EDITOR_ELEMENT_COPY_ATTR = [
|
|
|
315
340
|
"url",
|
|
316
341
|
"hyperlinkId",
|
|
317
342
|
"dateId",
|
|
318
|
-
"dateFormat"
|
|
343
|
+
"dateFormat",
|
|
344
|
+
"groupIds"
|
|
319
345
|
];
|
|
320
346
|
const EDITOR_ELEMENT_ZIP_ATTR = [
|
|
321
347
|
"type",
|
|
@@ -344,7 +370,8 @@ const EDITOR_ELEMENT_ZIP_ATTR = [
|
|
|
344
370
|
"level",
|
|
345
371
|
"listType",
|
|
346
372
|
"listStyle",
|
|
347
|
-
"listWrap"
|
|
373
|
+
"listWrap",
|
|
374
|
+
"groupIds"
|
|
348
375
|
];
|
|
349
376
|
const TABLE_CONTEXT_ATTR = [
|
|
350
377
|
"tdId",
|
|
@@ -3831,6 +3858,9 @@ function isSameElementExceptValue(source, target) {
|
|
|
3831
3858
|
const key = sourceKeys[s];
|
|
3832
3859
|
if (key === "value")
|
|
3833
3860
|
continue;
|
|
3861
|
+
if (key === "groupIds" && Array.isArray(source[key]) && Array.isArray(target[key]) && isArrayEqual(source[key], target[key])) {
|
|
3862
|
+
continue;
|
|
3863
|
+
}
|
|
3834
3864
|
if (source[key] !== target[key]) {
|
|
3835
3865
|
return false;
|
|
3836
3866
|
}
|
|
@@ -4092,6 +4122,9 @@ function convertElementToDom(element, options) {
|
|
|
4092
4122
|
if (element.highlight) {
|
|
4093
4123
|
dom.style.backgroundColor = element.highlight;
|
|
4094
4124
|
}
|
|
4125
|
+
if (element.underline) {
|
|
4126
|
+
dom.style.textDecoration = "underline";
|
|
4127
|
+
}
|
|
4095
4128
|
dom.innerText = element.value.replace(new RegExp(`${ZERO}`, "g"), "\n");
|
|
4096
4129
|
return dom;
|
|
4097
4130
|
}
|
|
@@ -4193,6 +4226,10 @@ function createDomFromElementList(elementList, options) {
|
|
|
4193
4226
|
checkbox.setAttribute("checked", "true");
|
|
4194
4227
|
}
|
|
4195
4228
|
clipboardDom.append(checkbox);
|
|
4229
|
+
} else if (element.type === ElementType.TAB) {
|
|
4230
|
+
const tab = document.createElement("span");
|
|
4231
|
+
tab.innerHTML = `${NON_BREAKING_SPACE}${NON_BREAKING_SPACE}`;
|
|
4232
|
+
clipboardDom.append(tab);
|
|
4196
4233
|
} else if (!element.type || element.type === ElementType.LATEX || TEXTLIKE_ELEMENT_TYPE.includes(element.type)) {
|
|
4197
4234
|
let text = "";
|
|
4198
4235
|
if (element.type === ElementType.CONTROL) {
|
|
@@ -4244,6 +4281,9 @@ function convertTextNodeToElement(textNode) {
|
|
|
4244
4281
|
if (style.backgroundColor !== "rgba(0, 0, 0, 0)") {
|
|
4245
4282
|
element.highlight = style.backgroundColor;
|
|
4246
4283
|
}
|
|
4284
|
+
if (style.textDecorationLine === "underline") {
|
|
4285
|
+
element.underline = true;
|
|
4286
|
+
}
|
|
4247
4287
|
return element;
|
|
4248
4288
|
}
|
|
4249
4289
|
function getElementListByHTML(htmlText, options) {
|
|
@@ -4495,6 +4535,9 @@ class CursorAgent {
|
|
|
4495
4535
|
this.canvasEvent.input(evt.data);
|
|
4496
4536
|
}
|
|
4497
4537
|
_paste(evt) {
|
|
4538
|
+
const isReadonly = this.draw.isReadonly();
|
|
4539
|
+
if (isReadonly)
|
|
4540
|
+
return;
|
|
4498
4541
|
const clipboardData = evt.clipboardData;
|
|
4499
4542
|
if (!clipboardData)
|
|
4500
4543
|
return;
|
|
@@ -5557,6 +5600,8 @@ function input(data2, host) {
|
|
|
5557
5600
|
const nextElement = elementList[endIndex + 1];
|
|
5558
5601
|
if (copyElement.type === TEXT || !copyElement.type && copyElement.value !== ZERO || copyElement.type === HYPERLINK && (nextElement == null ? void 0 : nextElement.type) === HYPERLINK || copyElement.type === DATE && (nextElement == null ? void 0 : nextElement.type) === DATE || copyElement.type === SUBSCRIPT && (nextElement == null ? void 0 : nextElement.type) === SUBSCRIPT || copyElement.type === SUPERSCRIPT && (nextElement == null ? void 0 : nextElement.type) === SUPERSCRIPT) {
|
|
5559
5602
|
EDITOR_ELEMENT_COPY_ATTR.forEach((attr) => {
|
|
5603
|
+
if (attr === "groupIds" && !(nextElement == null ? void 0 : nextElement.groupIds))
|
|
5604
|
+
return;
|
|
5560
5605
|
const value2 = copyElement[attr];
|
|
5561
5606
|
if (value2 !== void 0) {
|
|
5562
5607
|
newElement[attr] = value2;
|
|
@@ -5706,9 +5751,6 @@ function drop(evt, host) {
|
|
|
5706
5751
|
host.input(data2);
|
|
5707
5752
|
}
|
|
5708
5753
|
}
|
|
5709
|
-
const LETTER_REG = /[a-zA-Z]/;
|
|
5710
|
-
const NUMBER_LIKE_REG = /[0-9.]/;
|
|
5711
|
-
const WORD_LIKE_REG = /[^a-zA-Z][a-zA-Z]/;
|
|
5712
5754
|
function dblclick(host, evt) {
|
|
5713
5755
|
const draw = host.getDraw();
|
|
5714
5756
|
const position = draw.getPosition();
|
|
@@ -6176,6 +6218,7 @@ var EditorComponent;
|
|
|
6176
6218
|
EditorComponent2["CONTEXTMENU"] = "contextmenu";
|
|
6177
6219
|
EditorComponent2["POPUP"] = "popup";
|
|
6178
6220
|
EditorComponent2["CATALOG"] = "catalog";
|
|
6221
|
+
EditorComponent2["COMMENT"] = "comment";
|
|
6179
6222
|
})(EditorComponent || (EditorComponent = {}));
|
|
6180
6223
|
var EditorContext;
|
|
6181
6224
|
(function(EditorContext2) {
|
|
@@ -6752,7 +6795,7 @@ class RangeManager {
|
|
|
6752
6795
|
}
|
|
6753
6796
|
return rangeRow;
|
|
6754
6797
|
}
|
|
6755
|
-
|
|
6798
|
+
getRangeParagraphElementList() {
|
|
6756
6799
|
const { startIndex, endIndex } = this.range;
|
|
6757
6800
|
if (!~startIndex && !~endIndex)
|
|
6758
6801
|
return null;
|
|
@@ -6852,6 +6895,7 @@ class RangeManager {
|
|
|
6852
6895
|
const painter = !!this.draw.getPainterStyle();
|
|
6853
6896
|
const undo = this.historyManager.isCanUndo();
|
|
6854
6897
|
const redo = this.historyManager.isCanRedo();
|
|
6898
|
+
const groupIds = curElement.groupIds || null;
|
|
6855
6899
|
const rangeStyle = {
|
|
6856
6900
|
type,
|
|
6857
6901
|
undo,
|
|
@@ -6870,7 +6914,8 @@ class RangeManager {
|
|
|
6870
6914
|
dashArray,
|
|
6871
6915
|
level,
|
|
6872
6916
|
listType,
|
|
6873
|
-
listStyle
|
|
6917
|
+
listStyle,
|
|
6918
|
+
groupIds
|
|
6874
6919
|
};
|
|
6875
6920
|
if (rangeStyleChangeListener) {
|
|
6876
6921
|
rangeStyleChangeListener(rangeStyle);
|
|
@@ -6908,7 +6953,8 @@ class RangeManager {
|
|
|
6908
6953
|
dashArray: [],
|
|
6909
6954
|
level: null,
|
|
6910
6955
|
listType: null,
|
|
6911
|
-
listStyle: null
|
|
6956
|
+
listStyle: null,
|
|
6957
|
+
groupIds: null
|
|
6912
6958
|
};
|
|
6913
6959
|
if (rangeStyleChangeListener) {
|
|
6914
6960
|
rangeStyleChangeListener(rangeStyle);
|
|
@@ -7000,9 +7046,9 @@ class Background {
|
|
|
7000
7046
|
__publicField(this, "draw");
|
|
7001
7047
|
this.draw = draw;
|
|
7002
7048
|
}
|
|
7003
|
-
render(ctx) {
|
|
7004
|
-
const width = this.draw.
|
|
7005
|
-
const height = this.draw.
|
|
7049
|
+
render(ctx, pageNo) {
|
|
7050
|
+
const width = this.draw.getCanvasWidth(pageNo);
|
|
7051
|
+
const height = this.draw.getCanvasHeight(pageNo);
|
|
7006
7052
|
ctx.save();
|
|
7007
7053
|
ctx.fillStyle = "#ffffff";
|
|
7008
7054
|
ctx.fillRect(0, 0, width, height);
|
|
@@ -7382,7 +7428,7 @@ class Underline extends AbstractRichText {
|
|
|
7382
7428
|
const { x, y, width } = this.fillRect;
|
|
7383
7429
|
ctx.save();
|
|
7384
7430
|
ctx.strokeStyle = this.fillColor || underlineColor;
|
|
7385
|
-
const adjustY = y + 0.5;
|
|
7431
|
+
const adjustY = Math.floor(y + 2 * ctx.lineWidth) + 0.5;
|
|
7386
7432
|
ctx.beginPath();
|
|
7387
7433
|
ctx.moveTo(x, adjustY);
|
|
7388
7434
|
ctx.lineTo(x + width, adjustY);
|
|
@@ -7830,9 +7876,15 @@ class TableParticle {
|
|
|
7830
7876
|
continue;
|
|
7831
7877
|
if (pTdX > x)
|
|
7832
7878
|
break;
|
|
7833
|
-
if (
|
|
7834
|
-
|
|
7835
|
-
|
|
7879
|
+
if (pTdX === x && pTdY + pTdHeight > y) {
|
|
7880
|
+
const nextPTd = pTr.tdList[pD + 1];
|
|
7881
|
+
if (nextPTd && pTd.colIndex + pTd.colspan !== nextPTd.colIndex) {
|
|
7882
|
+
x = nextPTd.x;
|
|
7883
|
+
offsetXIndex = nextPTd.colIndex;
|
|
7884
|
+
} else {
|
|
7885
|
+
x += pTdWidth;
|
|
7886
|
+
offsetXIndex += pTd.colspan;
|
|
7887
|
+
}
|
|
7836
7888
|
}
|
|
7837
7889
|
}
|
|
7838
7890
|
}
|
|
@@ -9164,7 +9216,17 @@ class CheckboxParticle {
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c2goZSkpLG8rK31sKz1wKHMpfSghbi50eXBlfHxuLnR5cGU9PT1jLlRFWFQpJiYobCs9bi52YWx1ZSksbysrfXJldHVybiBsfWZ1bmN0aW9uIGQodCl7Y29uc3QgbD1bXSxvPS9bMC05XS8sbj0vW0EtWmEtel0vLGk9L1xzLztsZXQgcz0hMSxlPSExLHI9IiI7ZnVuY3Rpb24gYSgpe3ImJihsLnB1c2gocikscj0iIil9Zm9yKGNvbnN0IGYgb2YgdCluLnRlc3QoZik/KHN8fGEoKSxyKz1mLHM9ITAsZT0hMSk6by50ZXN0KGYpPyhlfHxhKCkscis9ZixzPSExLGU9ITApOihhKCkscz0hMSxlPSExLGkudGVzdChmKXx8bC5wdXNoKGYpKTtyZXR1cm4gYSgpLGx9b25tZXNzYWdlPXQ9Pntjb25zdCBsPXQuZGF0YSxuPXAobCkucmVwbGFjZShuZXcgUmVnRXhwKGBeJHtofWApLCIiKS5yZXBsYWNlKG5ldyBSZWdFeHAoaCwiZyIpLGcpLGk9ZChuKTtwb3N0TWVzc2FnZShpLmxlbmd0aCl9fSkoKTt9KSgpOwo=";
|
|
9220
|
+
const blob$2 = typeof window !== "undefined" && window.Blob && new Blob([atob(encodedJs$2)], { type: "text/javascript;charset=utf-8" });
|
|
9221
|
+
function WorkerWrapper$2() {
|
|
9222
|
+
const objURL = blob$2 && (window.URL || window.webkitURL).createObjectURL(blob$2);
|
|
9223
|
+
try {
|
|
9224
|
+
return objURL ? new Worker(objURL) : new Worker("data:application/javascript;base64," + encodedJs$2, { type: "module" });
|
|
9225
|
+
} finally {
|
|
9226
|
+
objURL && (window.URL || window.webkitURL).revokeObjectURL(objURL);
|
|
9227
|
+
}
|
|
9228
|
+
}
|
|
9229
|
+
const encodedJs$1 = "KCgpPT57KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBnOyhmdW5jdGlvbihlKXtlLlRJVExFPSJ0aXRsZSJ9KShnfHwoZz17fSkpO3ZhciBvOyhmdW5jdGlvbihlK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W51bGw/dm9pZCAwOmwubGV2ZWxdLGk9dVtuLmxldmVsXTtsJiZpPmM/aChuLGwpOnIucHVzaCh7aWQ6bi50aXRsZUlkLG5hbWU6bi52YWx1ZSxsZXZlbDpuLmxldmVsLHN1YkNhdGFsb2c6W119KX1yZXR1cm4gcn1vbm1lc3NhZ2U9ZT0+e2NvbnN0IGE9ZS5kYXRhLHM9ZihhKTtwb3N0TWVzc2FnZShzKX19KSgpO30pKCk7Cg==";
|
|
9168
9230
|
const blob$1 = typeof window !== "undefined" && window.Blob && new Blob([atob(encodedJs$1)], { type: "text/javascript;charset=utf-8" });
|
|
9169
9231
|
function WorkerWrapper$1() {
|
|
9170
9232
|
const objURL = blob$1 && (window.URL || window.webkitURL).createObjectURL(blob$1);
|
|
@@ -9174,7 +9236,7 @@ function WorkerWrapper$1() {
|
|
|
9174
9236
|
objURL && (window.URL || window.webkitURL).revokeObjectURL(objURL);
|
|
9175
9237
|
}
|
|
9176
9238
|
}
|
|
9177
|
-
const encodedJs = "
|
|
9239
|
+
const encodedJs = "KCgpPT57KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBuOyhmdW5jdGlvbihvKXtvLlRBQkxFPSJ0YWJsZSJ9KShufHwobj17fSkpO2Z1bmN0aW9uIGMobyl7Y29uc3QgdD1bXTtmb3IoY29uc3QgcyBvZiBvKXtpZihzLnR5cGU9PT1uLlRBQkxFKXtjb25zdCBlPXMudHJMaXN0O2ZvcihsZXQgcj0wO3I8ZS5sZW5ndGg7cisrKXtjb25zdCBpPWVbcl07Zm9yKGxldCB1PTA7dTxpLnRkTGlzdC5sZW5ndGg7dSsrKXtjb25zdCBkPWkudGRMaXN0W3VdO3QucHVzaCguLi5jKGQudmFsdWUpKX19fWlmKCEhcy5ncm91cElkcylmb3IoY29uc3QgZSBvZiBzLmdyb3VwSWRzKXQuaW5jbHVkZXMoZSl8fHQucHVzaChlKX1yZXR1cm4gdH1vbm1lc3NhZ2U9bz0+e2NvbnN0IHQ9by5kYXRhLHM9Yyh0KTtwb3N0TWVzc2FnZShzKX19KSgpO30pKCk7Cg==";
|
|
9178
9240
|
const blob = typeof window !== "undefined" && window.Blob && new Blob([atob(encodedJs)], { type: "text/javascript;charset=utf-8" });
|
|
9179
9241
|
function WorkerWrapper() {
|
|
9180
9242
|
const objURL = blob && (window.URL || window.webkitURL).createObjectURL(blob);
|
|
@@ -9189,9 +9251,11 @@ class WorkerManager {
|
|
|
9189
9251
|
__publicField(this, "draw");
|
|
9190
9252
|
__publicField(this, "wordCountWorker");
|
|
9191
9253
|
__publicField(this, "catalogWorker");
|
|
9254
|
+
__publicField(this, "groupWorker");
|
|
9192
9255
|
this.draw = draw;
|
|
9193
|
-
this.wordCountWorker = new WorkerWrapper$
|
|
9194
|
-
this.catalogWorker = new WorkerWrapper();
|
|
9256
|
+
this.wordCountWorker = new WorkerWrapper$2();
|
|
9257
|
+
this.catalogWorker = new WorkerWrapper$1();
|
|
9258
|
+
this.groupWorker = new WorkerWrapper();
|
|
9195
9259
|
}
|
|
9196
9260
|
getWordCount() {
|
|
9197
9261
|
return new Promise((resolve, reject) => {
|
|
@@ -9217,6 +9281,18 @@ class WorkerManager {
|
|
|
9217
9281
|
this.catalogWorker.postMessage(elementList);
|
|
9218
9282
|
});
|
|
9219
9283
|
}
|
|
9284
|
+
getGroupIds() {
|
|
9285
|
+
return new Promise((resolve, reject) => {
|
|
9286
|
+
this.groupWorker.onmessage = (evt) => {
|
|
9287
|
+
resolve(evt.data);
|
|
9288
|
+
};
|
|
9289
|
+
this.groupWorker.onerror = (evt) => {
|
|
9290
|
+
reject(evt);
|
|
9291
|
+
};
|
|
9292
|
+
const elementList = this.draw.getOriginalMainElementList();
|
|
9293
|
+
this.groupWorker.postMessage(elementList);
|
|
9294
|
+
});
|
|
9295
|
+
}
|
|
9220
9296
|
}
|
|
9221
9297
|
class Previewer {
|
|
9222
9298
|
constructor(draw) {
|
|
@@ -10389,6 +10465,9 @@ class I18n {
|
|
|
10389
10465
|
const sourceLang = this.langMap.get(locale);
|
|
10390
10466
|
this.langMap.set(locale, mergeObject(sourceLang || zhCN, lang));
|
|
10391
10467
|
}
|
|
10468
|
+
getLocale() {
|
|
10469
|
+
return this.currentLocale;
|
|
10470
|
+
}
|
|
10392
10471
|
setLocale(locale) {
|
|
10393
10472
|
this.currentLocale = locale;
|
|
10394
10473
|
}
|
|
@@ -10801,6 +10880,167 @@ class Placeholder {
|
|
|
10801
10880
|
ctx.restore();
|
|
10802
10881
|
}
|
|
10803
10882
|
}
|
|
10883
|
+
class Group {
|
|
10884
|
+
constructor(draw) {
|
|
10885
|
+
__publicField(this, "draw");
|
|
10886
|
+
__publicField(this, "options");
|
|
10887
|
+
__publicField(this, "range");
|
|
10888
|
+
__publicField(this, "fillRectMap");
|
|
10889
|
+
this.draw = draw;
|
|
10890
|
+
this.options = draw.getOptions();
|
|
10891
|
+
this.range = draw.getRange();
|
|
10892
|
+
this.fillRectMap = new Map();
|
|
10893
|
+
}
|
|
10894
|
+
setGroup() {
|
|
10895
|
+
if (this.draw.isReadonly() || this.draw.getZone().getZone() !== EditorZone.MAIN) {
|
|
10896
|
+
return null;
|
|
10897
|
+
}
|
|
10898
|
+
const selection = this.range.getSelection();
|
|
10899
|
+
if (!selection)
|
|
10900
|
+
return null;
|
|
10901
|
+
const groupId = getUUID();
|
|
10902
|
+
selection.forEach((el) => {
|
|
10903
|
+
if (!Array.isArray(el.groupIds)) {
|
|
10904
|
+
el.groupIds = [];
|
|
10905
|
+
}
|
|
10906
|
+
el.groupIds.push(groupId);
|
|
10907
|
+
});
|
|
10908
|
+
this.draw.render({
|
|
10909
|
+
isSetCursor: false,
|
|
10910
|
+
isCompute: false
|
|
10911
|
+
});
|
|
10912
|
+
return groupId;
|
|
10913
|
+
}
|
|
10914
|
+
getElementListByGroupId(elementList, groupId) {
|
|
10915
|
+
var _a, _b;
|
|
10916
|
+
const groupElementList = [];
|
|
10917
|
+
for (let e = 0; e < elementList.length; e++) {
|
|
10918
|
+
const element = elementList[e];
|
|
10919
|
+
if (element.type === ElementType.TABLE) {
|
|
10920
|
+
const trList = element.trList;
|
|
10921
|
+
for (let r = 0; r < trList.length; r++) {
|
|
10922
|
+
const tr = trList[r];
|
|
10923
|
+
for (let d = 0; d < tr.tdList.length; d++) {
|
|
10924
|
+
const td = tr.tdList[d];
|
|
10925
|
+
const tdGroupElementList = this.getElementListByGroupId(td.value, groupId);
|
|
10926
|
+
if (tdGroupElementList.length) {
|
|
10927
|
+
groupElementList.push(...tdGroupElementList);
|
|
10928
|
+
return groupElementList;
|
|
10929
|
+
}
|
|
10930
|
+
}
|
|
10931
|
+
}
|
|
10932
|
+
}
|
|
10933
|
+
if ((_a = element == null ? void 0 : element.groupIds) == null ? void 0 : _a.includes(groupId)) {
|
|
10934
|
+
groupElementList.push(element);
|
|
10935
|
+
const nextElement = elementList[e + 1];
|
|
10936
|
+
if (!((_b = nextElement == null ? void 0 : nextElement.groupIds) == null ? void 0 : _b.includes(groupId)))
|
|
10937
|
+
break;
|
|
10938
|
+
}
|
|
10939
|
+
}
|
|
10940
|
+
return groupElementList;
|
|
10941
|
+
}
|
|
10942
|
+
deleteGroup(groupId) {
|
|
10943
|
+
if (this.draw.isReadonly())
|
|
10944
|
+
return;
|
|
10945
|
+
const elementList = this.draw.getOriginalMainElementList();
|
|
10946
|
+
const groupElementList = this.getElementListByGroupId(elementList, groupId);
|
|
10947
|
+
if (!groupElementList.length)
|
|
10948
|
+
return;
|
|
10949
|
+
for (let e = 0; e < groupElementList.length; e++) {
|
|
10950
|
+
const element = groupElementList[e];
|
|
10951
|
+
const groupIds = element.groupIds;
|
|
10952
|
+
const groupIndex = groupIds.findIndex((id) => id === groupId);
|
|
10953
|
+
groupIds.splice(groupIndex, 1);
|
|
10954
|
+
if (!groupIds.length) {
|
|
10955
|
+
delete element.groupIds;
|
|
10956
|
+
}
|
|
10957
|
+
}
|
|
10958
|
+
this.draw.render({
|
|
10959
|
+
isSetCursor: false,
|
|
10960
|
+
isCompute: false
|
|
10961
|
+
});
|
|
10962
|
+
}
|
|
10963
|
+
getContextByGroupId(elementList, groupId) {
|
|
10964
|
+
var _a, _b;
|
|
10965
|
+
for (let e = 0; e < elementList.length; e++) {
|
|
10966
|
+
const element = elementList[e];
|
|
10967
|
+
if (element.type === ElementType.TABLE) {
|
|
10968
|
+
const trList = element.trList;
|
|
10969
|
+
for (let r = 0; r < trList.length; r++) {
|
|
10970
|
+
const tr = trList[r];
|
|
10971
|
+
for (let d = 0; d < tr.tdList.length; d++) {
|
|
10972
|
+
const td = tr.tdList[d];
|
|
10973
|
+
const range = this.getContextByGroupId(td.value, groupId);
|
|
10974
|
+
if (range) {
|
|
10975
|
+
return __spreadProps(__spreadValues({}, range), {
|
|
10976
|
+
isTable: true,
|
|
10977
|
+
index: e,
|
|
10978
|
+
trIndex: r,
|
|
10979
|
+
tdIndex: d,
|
|
10980
|
+
tdId: td.id,
|
|
10981
|
+
trId: tr.id,
|
|
10982
|
+
tableId: element.tableId
|
|
10983
|
+
});
|
|
10984
|
+
}
|
|
10985
|
+
}
|
|
10986
|
+
}
|
|
10987
|
+
}
|
|
10988
|
+
const nextElement = elementList[e + 1];
|
|
10989
|
+
if (((_a = element.groupIds) == null ? void 0 : _a.includes(groupId)) && !((_b = nextElement == null ? void 0 : nextElement.groupIds) == null ? void 0 : _b.includes(groupId))) {
|
|
10990
|
+
return {
|
|
10991
|
+
isTable: false,
|
|
10992
|
+
startIndex: e,
|
|
10993
|
+
endIndex: e
|
|
10994
|
+
};
|
|
10995
|
+
}
|
|
10996
|
+
}
|
|
10997
|
+
return null;
|
|
10998
|
+
}
|
|
10999
|
+
clearFillInfo() {
|
|
11000
|
+
this.fillRectMap.clear();
|
|
11001
|
+
}
|
|
11002
|
+
recordFillInfo(element, x, y, width, height) {
|
|
11003
|
+
const groupIds = element.groupIds;
|
|
11004
|
+
if (!groupIds)
|
|
11005
|
+
return;
|
|
11006
|
+
for (const groupId of groupIds) {
|
|
11007
|
+
const fillRect = this.fillRectMap.get(groupId);
|
|
11008
|
+
if (!fillRect) {
|
|
11009
|
+
this.fillRectMap.set(groupId, {
|
|
11010
|
+
x,
|
|
11011
|
+
y,
|
|
11012
|
+
width,
|
|
11013
|
+
height
|
|
11014
|
+
});
|
|
11015
|
+
} else {
|
|
11016
|
+
fillRect.width += width;
|
|
11017
|
+
}
|
|
11018
|
+
}
|
|
11019
|
+
}
|
|
11020
|
+
render(ctx) {
|
|
11021
|
+
var _a;
|
|
11022
|
+
if (!this.fillRectMap.size)
|
|
11023
|
+
return;
|
|
11024
|
+
const range = this.range.getRange();
|
|
11025
|
+
const elementList = this.draw.getElementList();
|
|
11026
|
+
const anchorGroupIds = (_a = elementList[range.endIndex]) == null ? void 0 : _a.groupIds;
|
|
11027
|
+
const { group: { backgroundColor, opacity, activeOpacity, activeBackgroundColor } } = this.options;
|
|
11028
|
+
ctx.save();
|
|
11029
|
+
this.fillRectMap.forEach((fillRect, groupId) => {
|
|
11030
|
+
const { x, y, width, height } = fillRect;
|
|
11031
|
+
if (anchorGroupIds == null ? void 0 : anchorGroupIds.includes(groupId)) {
|
|
11032
|
+
ctx.globalAlpha = activeOpacity;
|
|
11033
|
+
ctx.fillStyle = activeBackgroundColor;
|
|
11034
|
+
} else {
|
|
11035
|
+
ctx.globalAlpha = opacity;
|
|
11036
|
+
ctx.fillStyle = backgroundColor;
|
|
11037
|
+
}
|
|
11038
|
+
ctx.fillRect(x, y, width, height);
|
|
11039
|
+
});
|
|
11040
|
+
ctx.restore();
|
|
11041
|
+
this.clearFillInfo();
|
|
11042
|
+
}
|
|
11043
|
+
}
|
|
10804
11044
|
class Draw {
|
|
10805
11045
|
constructor(rootContainer, options, data2, listener, eventBus) {
|
|
10806
11046
|
__publicField(this, "container");
|
|
@@ -10824,6 +11064,7 @@ class Draw {
|
|
|
10824
11064
|
__publicField(this, "margin");
|
|
10825
11065
|
__publicField(this, "background");
|
|
10826
11066
|
__publicField(this, "search");
|
|
11067
|
+
__publicField(this, "group");
|
|
10827
11068
|
__publicField(this, "underline");
|
|
10828
11069
|
__publicField(this, "strikeout");
|
|
10829
11070
|
__publicField(this, "highlight");
|
|
@@ -10882,6 +11123,7 @@ class Draw {
|
|
|
10882
11123
|
this.margin = new Margin(this);
|
|
10883
11124
|
this.background = new Background(this);
|
|
10884
11125
|
this.search = new Search(this);
|
|
11126
|
+
this.group = new Group(this);
|
|
10885
11127
|
this.underline = new Underline(this);
|
|
10886
11128
|
this.strikeout = new Strikeout(this);
|
|
10887
11129
|
this.highlight = new Highlight(this);
|
|
@@ -11104,6 +11346,9 @@ class Draw {
|
|
|
11104
11346
|
getSearch() {
|
|
11105
11347
|
return this.search;
|
|
11106
11348
|
}
|
|
11349
|
+
getGroup() {
|
|
11350
|
+
return this.group;
|
|
11351
|
+
}
|
|
11107
11352
|
getHistoryManager() {
|
|
11108
11353
|
return this.historyManager;
|
|
11109
11354
|
}
|
|
@@ -11887,7 +12132,7 @@ class Draw {
|
|
|
11887
12132
|
drawRow(ctx, payload) {
|
|
11888
12133
|
const { rowList, pageNo, elementList, positionList, startIndex, zone } = payload;
|
|
11889
12134
|
const isPrintMode = this.mode === EditorMode.PRINT;
|
|
11890
|
-
const { scale, tdPadding } = this.options;
|
|
12135
|
+
const { scale, tdPadding, defaultBasicRowMarginHeight, defaultRowMargin, group: group2 } = this.options;
|
|
11891
12136
|
const { isCrossRowCol, tableId } = this.range.getRange();
|
|
11892
12137
|
let index2 = startIndex;
|
|
11893
12138
|
for (let i = 0; i < rowList.length; i++) {
|
|
@@ -11958,7 +12203,8 @@ class Draw {
|
|
|
11958
12203
|
this.textParticle.record(ctx, element, x, y + offsetY);
|
|
11959
12204
|
}
|
|
11960
12205
|
if (element.underline) {
|
|
11961
|
-
|
|
12206
|
+
const rowMargin = defaultBasicRowMarginHeight * (element.rowMargin || defaultRowMargin) * scale;
|
|
12207
|
+
this.underline.recordFillInfo(ctx, x, y + curRow.height - rowMargin, metrics.width, 0, element.color);
|
|
11962
12208
|
} else if (preElement == null ? void 0 : preElement.underline) {
|
|
11963
12209
|
this.underline.render(ctx);
|
|
11964
12210
|
}
|
|
@@ -11993,6 +12239,9 @@ class Draw {
|
|
|
11993
12239
|
}
|
|
11994
12240
|
}
|
|
11995
12241
|
}
|
|
12242
|
+
if (!group2.disabled && element.groupIds) {
|
|
12243
|
+
this.group.recordFillInfo(element, x, y, metrics.width, curRow.height);
|
|
12244
|
+
}
|
|
11996
12245
|
index2++;
|
|
11997
12246
|
if (element.type === ElementType.TABLE) {
|
|
11998
12247
|
const tdGap = tdPadding * 2;
|
|
@@ -12017,6 +12266,7 @@ class Draw {
|
|
|
12017
12266
|
this.listParticle.drawListStyle(ctx, curRow, positionList[curRow.startIndex]);
|
|
12018
12267
|
}
|
|
12019
12268
|
this._drawRichText(ctx);
|
|
12269
|
+
this.group.render(ctx);
|
|
12020
12270
|
if (!isPrintMode) {
|
|
12021
12271
|
if (rangeRecord.width && rangeRecord.height) {
|
|
12022
12272
|
const { x, y, width, height } = rangeRecord;
|
|
@@ -12042,7 +12292,7 @@ class Draw {
|
|
|
12042
12292
|
const ctx = this.ctxList[pageNo];
|
|
12043
12293
|
ctx.globalAlpha = !this.zone.isMainActive() ? inactiveAlpha : 1;
|
|
12044
12294
|
this._clearPage(pageNo);
|
|
12045
|
-
this.background.render(ctx);
|
|
12295
|
+
this.background.render(ctx, pageNo);
|
|
12046
12296
|
this.margin.render(ctx, pageNo);
|
|
12047
12297
|
const index2 = rowList[0].startIndex;
|
|
12048
12298
|
this.drawRow(ctx, {
|
|
@@ -12115,7 +12365,7 @@ class Draw {
|
|
|
12115
12365
|
render(payload) {
|
|
12116
12366
|
var _a;
|
|
12117
12367
|
const { header, footer } = this.options;
|
|
12118
|
-
const { isSubmitHistory = true, isSetCursor = true, isCompute = true, isLazy = true, isInit = false } = payload || {};
|
|
12368
|
+
const { isSubmitHistory = true, isSetCursor = true, isCompute = true, isLazy = true, isInit = false, isSourceHistory = false } = payload || {};
|
|
12119
12369
|
let { curIndex } = payload || {};
|
|
12120
12370
|
const innerWidth = this.getInnerWidth();
|
|
12121
12371
|
const isPagingMode = this.getIsPagingMode();
|
|
@@ -12189,7 +12439,11 @@ class Draw {
|
|
|
12189
12439
|
self.footer.setElementList(deepClone(oldFooterElementList));
|
|
12190
12440
|
self.elementList = deepClone(oldElementList);
|
|
12191
12441
|
self.range.setRange(startIndex, endIndex);
|
|
12192
|
-
self.render({
|
|
12442
|
+
self.render({
|
|
12443
|
+
curIndex,
|
|
12444
|
+
isSubmitHistory: false,
|
|
12445
|
+
isSourceHistory: true
|
|
12446
|
+
});
|
|
12193
12447
|
});
|
|
12194
12448
|
}
|
|
12195
12449
|
nextTick(() => {
|
|
@@ -12205,7 +12459,7 @@ class Draw {
|
|
|
12205
12459
|
if (this.eventBus.isSubscribe("pageSizeChange")) {
|
|
12206
12460
|
this.eventBus.emit("pageSizeChange", this.pageRowList.length);
|
|
12207
12461
|
}
|
|
12208
|
-
if (isSubmitHistory && !isInit) {
|
|
12462
|
+
if ((isSubmitHistory || isSourceHistory) && !isInit) {
|
|
12209
12463
|
if (this.listener.contentChange) {
|
|
12210
12464
|
this.listener.contentChange();
|
|
12211
12465
|
}
|
|
@@ -12298,6 +12552,9 @@ class Command {
|
|
|
12298
12552
|
__publicField(this, "executeLocationCatalog");
|
|
12299
12553
|
__publicField(this, "executeWordTool");
|
|
12300
12554
|
__publicField(this, "executeSetHTML");
|
|
12555
|
+
__publicField(this, "executeSetGroup");
|
|
12556
|
+
__publicField(this, "executeDeleteGroup");
|
|
12557
|
+
__publicField(this, "executeLocationGroup");
|
|
12301
12558
|
__publicField(this, "getCatalog");
|
|
12302
12559
|
__publicField(this, "getImage");
|
|
12303
12560
|
__publicField(this, "getValue");
|
|
@@ -12306,8 +12563,12 @@ class Command {
|
|
|
12306
12563
|
__publicField(this, "getWordCount");
|
|
12307
12564
|
__publicField(this, "getRangeText");
|
|
12308
12565
|
__publicField(this, "getRangeContext");
|
|
12566
|
+
__publicField(this, "getRangeRow");
|
|
12567
|
+
__publicField(this, "getRangeParagraph");
|
|
12309
12568
|
__publicField(this, "getPaperMargin");
|
|
12310
12569
|
__publicField(this, "getSearchNavigateInfo");
|
|
12570
|
+
__publicField(this, "getLocale");
|
|
12571
|
+
__publicField(this, "getGroupIds");
|
|
12311
12572
|
this.executeMode = adapt.mode.bind(adapt);
|
|
12312
12573
|
this.executeCut = adapt.cut.bind(adapt);
|
|
12313
12574
|
this.executeCopy = adapt.copy.bind(adapt);
|
|
@@ -12382,6 +12643,9 @@ class Command {
|
|
|
12382
12643
|
this.executeLocationCatalog = adapt.locationCatalog.bind(adapt);
|
|
12383
12644
|
this.executeWordTool = adapt.wordTool.bind(adapt);
|
|
12384
12645
|
this.executeSetHTML = adapt.setHTML.bind(adapt);
|
|
12646
|
+
this.executeSetGroup = adapt.setGroup.bind(adapt);
|
|
12647
|
+
this.executeDeleteGroup = adapt.deleteGroup.bind(adapt);
|
|
12648
|
+
this.executeLocationGroup = adapt.locationGroup.bind(adapt);
|
|
12385
12649
|
this.getImage = adapt.getImage.bind(adapt);
|
|
12386
12650
|
this.getValue = adapt.getValue.bind(adapt);
|
|
12387
12651
|
this.getHTML = adapt.getHTML.bind(adapt);
|
|
@@ -12389,9 +12653,13 @@ class Command {
|
|
|
12389
12653
|
this.getWordCount = adapt.getWordCount.bind(adapt);
|
|
12390
12654
|
this.getRangeText = adapt.getRangeText.bind(adapt);
|
|
12391
12655
|
this.getRangeContext = adapt.getRangeContext.bind(adapt);
|
|
12656
|
+
this.getRangeRow = adapt.getRangeRow.bind(adapt);
|
|
12657
|
+
this.getRangeParagraph = adapt.getRangeParagraph.bind(adapt);
|
|
12392
12658
|
this.getCatalog = adapt.getCatalog.bind(adapt);
|
|
12393
12659
|
this.getPaperMargin = adapt.getPaperMargin.bind(adapt);
|
|
12394
12660
|
this.getSearchNavigateInfo = adapt.getSearchNavigateInfo.bind(adapt);
|
|
12661
|
+
this.getLocale = adapt.getLocale.bind(adapt);
|
|
12662
|
+
this.getGroupIds = adapt.getGroupIds.bind(adapt);
|
|
12395
12663
|
}
|
|
12396
12664
|
}
|
|
12397
12665
|
const defaultWatermarkOption = {
|
|
@@ -12702,7 +12970,10 @@ class CommandAdapt {
|
|
|
12702
12970
|
selection.forEach((el) => {
|
|
12703
12971
|
el.underline = !!~noUnderlineIndex;
|
|
12704
12972
|
});
|
|
12705
|
-
this.draw.render({
|
|
12973
|
+
this.draw.render({
|
|
12974
|
+
isSetCursor: false,
|
|
12975
|
+
isCompute: false
|
|
12976
|
+
});
|
|
12706
12977
|
}
|
|
12707
12978
|
strikeout() {
|
|
12708
12979
|
const isReadonly = this.draw.isReadonly();
|
|
@@ -12715,7 +12986,10 @@ class CommandAdapt {
|
|
|
12715
12986
|
selection.forEach((el) => {
|
|
12716
12987
|
el.strikeout = !!~noStrikeoutIndex;
|
|
12717
12988
|
});
|
|
12718
|
-
this.draw.render({
|
|
12989
|
+
this.draw.render({
|
|
12990
|
+
isSetCursor: false,
|
|
12991
|
+
isCompute: false
|
|
12992
|
+
});
|
|
12719
12993
|
}
|
|
12720
12994
|
superscript() {
|
|
12721
12995
|
const isReadonly = this.draw.isReadonly();
|
|
@@ -12805,7 +13079,7 @@ class CommandAdapt {
|
|
|
12805
13079
|
if (!~startIndex && !~endIndex)
|
|
12806
13080
|
return;
|
|
12807
13081
|
const elementList = this.draw.getElementList();
|
|
12808
|
-
const changeElementList = startIndex === endIndex ? this.range.
|
|
13082
|
+
const changeElementList = startIndex === endIndex ? this.range.getRangeParagraphElementList() : elementList.slice(startIndex + 1, endIndex + 1);
|
|
12809
13083
|
if (!changeElementList || !changeElementList.length)
|
|
12810
13084
|
return;
|
|
12811
13085
|
const titleId = getUUID();
|
|
@@ -12840,7 +13114,7 @@ class CommandAdapt {
|
|
|
12840
13114
|
const { startIndex, endIndex } = this.range.getRange();
|
|
12841
13115
|
if (!~startIndex && !~endIndex)
|
|
12842
13116
|
return;
|
|
12843
|
-
const changeElementList = this.range.
|
|
13117
|
+
const changeElementList = this.range.getRangeParagraphElementList();
|
|
12844
13118
|
if (!changeElementList || !changeElementList.length)
|
|
12845
13119
|
return;
|
|
12846
13120
|
const isUnsetList = changeElementList.find((el) => el.listType === listType && el.listStyle === listStyle);
|
|
@@ -14010,6 +14284,14 @@ class CommandAdapt {
|
|
|
14010
14284
|
endPageNo
|
|
14011
14285
|
});
|
|
14012
14286
|
}
|
|
14287
|
+
getRangeRow() {
|
|
14288
|
+
const rowElementList = this.range.getRangeRowElementList();
|
|
14289
|
+
return rowElementList ? zipElementList(rowElementList) : null;
|
|
14290
|
+
}
|
|
14291
|
+
getRangeParagraph() {
|
|
14292
|
+
const paragraphElementList = this.range.getRangeParagraphElementList();
|
|
14293
|
+
return paragraphElementList ? zipElementList(paragraphElementList) : null;
|
|
14294
|
+
}
|
|
14013
14295
|
pageMode(payload) {
|
|
14014
14296
|
this.draw.setPageMode(payload);
|
|
14015
14297
|
}
|
|
@@ -14085,6 +14367,9 @@ class CommandAdapt {
|
|
|
14085
14367
|
setLocale(payload) {
|
|
14086
14368
|
this.i18n.setLocale(payload);
|
|
14087
14369
|
}
|
|
14370
|
+
getLocale() {
|
|
14371
|
+
return this.i18n.getLocale();
|
|
14372
|
+
}
|
|
14088
14373
|
getCatalog() {
|
|
14089
14374
|
return this.workerManager.getCatalog();
|
|
14090
14375
|
}
|
|
@@ -14146,6 +14431,43 @@ class CommandAdapt {
|
|
|
14146
14431
|
footer: getElementList(footer)
|
|
14147
14432
|
});
|
|
14148
14433
|
}
|
|
14434
|
+
setGroup() {
|
|
14435
|
+
const isReadonly = this.draw.isReadonly();
|
|
14436
|
+
if (isReadonly)
|
|
14437
|
+
return null;
|
|
14438
|
+
return this.draw.getGroup().setGroup();
|
|
14439
|
+
}
|
|
14440
|
+
deleteGroup(groupId) {
|
|
14441
|
+
const isReadonly = this.draw.isReadonly();
|
|
14442
|
+
if (isReadonly)
|
|
14443
|
+
return;
|
|
14444
|
+
this.draw.getGroup().deleteGroup(groupId);
|
|
14445
|
+
}
|
|
14446
|
+
getGroupIds() {
|
|
14447
|
+
return this.draw.getWorkerManager().getGroupIds();
|
|
14448
|
+
}
|
|
14449
|
+
locationGroup(groupId) {
|
|
14450
|
+
const elementList = this.draw.getOriginalMainElementList();
|
|
14451
|
+
const context = this.draw.getGroup().getContextByGroupId(elementList, groupId);
|
|
14452
|
+
if (!context)
|
|
14453
|
+
return;
|
|
14454
|
+
const { isTable, index: index2, trIndex, tdIndex, tdId, trId, tableId, endIndex } = context;
|
|
14455
|
+
this.position.setPositionContext({
|
|
14456
|
+
isTable,
|
|
14457
|
+
index: index2,
|
|
14458
|
+
trIndex,
|
|
14459
|
+
tdIndex,
|
|
14460
|
+
tdId,
|
|
14461
|
+
trId,
|
|
14462
|
+
tableId
|
|
14463
|
+
});
|
|
14464
|
+
this.range.setRange(endIndex, endIndex);
|
|
14465
|
+
this.draw.render({
|
|
14466
|
+
curIndex: endIndex,
|
|
14467
|
+
isCompute: false,
|
|
14468
|
+
isSubmitHistory: false
|
|
14469
|
+
});
|
|
14470
|
+
}
|
|
14149
14471
|
}
|
|
14150
14472
|
class Listener {
|
|
14151
14473
|
constructor() {
|
|
@@ -14595,6 +14917,7 @@ class ContextMenu {
|
|
|
14595
14917
|
const elementList = this.draw.getElementList();
|
|
14596
14918
|
const startElement = elementList[startIndex] || null;
|
|
14597
14919
|
const endElement = elementList[endIndex] || null;
|
|
14920
|
+
const zone = this.draw.getZone().getZone();
|
|
14598
14921
|
return {
|
|
14599
14922
|
startElement,
|
|
14600
14923
|
endElement,
|
|
@@ -14602,7 +14925,8 @@ class ContextMenu {
|
|
|
14602
14925
|
editorHasSelection,
|
|
14603
14926
|
editorTextFocus,
|
|
14604
14927
|
isInTable,
|
|
14605
|
-
isCrossRowCol
|
|
14928
|
+
isCrossRowCol,
|
|
14929
|
+
zone
|
|
14606
14930
|
};
|
|
14607
14931
|
}
|
|
14608
14932
|
_createContextMenuContainer() {
|
|
@@ -15015,6 +15339,13 @@ class EventBus {
|
|
|
15015
15339
|
return !!eventSet && eventSet.size > 0;
|
|
15016
15340
|
}
|
|
15017
15341
|
}
|
|
15342
|
+
const defaultGroupOption = {
|
|
15343
|
+
opacity: 0.1,
|
|
15344
|
+
backgroundColor: "#E99D00",
|
|
15345
|
+
activeOpacity: 0.5,
|
|
15346
|
+
activeBackgroundColor: "#E99D00",
|
|
15347
|
+
disabled: false
|
|
15348
|
+
};
|
|
15018
15349
|
class Editor {
|
|
15019
15350
|
constructor(container, data2, options = {}) {
|
|
15020
15351
|
__publicField(this, "command");
|
|
@@ -15032,6 +15363,7 @@ class Editor {
|
|
|
15032
15363
|
const cursorOptions = __spreadValues(__spreadValues({}, defaultCursorOption), options.cursor);
|
|
15033
15364
|
const titleOptions = __spreadValues(__spreadValues({}, defaultTitleOption), options.title);
|
|
15034
15365
|
const placeholderOptions = __spreadValues(__spreadValues({}, defaultPlaceholderOption), options.placeholder);
|
|
15366
|
+
const groupOptions = __spreadValues(__spreadValues({}, defaultGroupOption), options.group);
|
|
15035
15367
|
const editorOptions = __spreadProps(__spreadValues({
|
|
15036
15368
|
mode: EditorMode.EDIT,
|
|
15037
15369
|
defaultType: "TEXT",
|
|
@@ -15080,7 +15412,8 @@ class Editor {
|
|
|
15080
15412
|
checkbox: checkboxOptions,
|
|
15081
15413
|
cursor: cursorOptions,
|
|
15082
15414
|
title: titleOptions,
|
|
15083
|
-
placeholder: placeholderOptions
|
|
15415
|
+
placeholder: placeholderOptions,
|
|
15416
|
+
group: groupOptions
|
|
15084
15417
|
});
|
|
15085
15418
|
let headerElementList = [];
|
|
15086
15419
|
let mainElementList = [];
|