@hufe921/canvas-editor 0.9.83 → 0.9.85
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 +43 -0
- package/dist/canvas-editor.es.js +119 -75
- package/dist/canvas-editor.es.js.map +1 -1
- package/dist/canvas-editor.umd.js +39 -39
- package/dist/canvas-editor.umd.js.map +1 -1
- package/dist/src/editor/core/override/Override.d.ts +6 -3
- package/dist/src/editor/dataset/enum/Editor.d.ts +4 -0
- package/dist/src/editor/index.d.ts +2 -2
- package/dist/src/editor/interface/Editor.d.ts +2 -1
- package/dist/src/editor/interface/Previewer.d.ts +1 -0
- package/dist/src/editor/interface/Title.d.ts +5 -2
- package/dist/src/editor/interface/contextmenu/ContextMenu.d.ts +3 -0
- package/dist/src/editor/interface/table/Td.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,46 @@
|
|
|
1
|
+
## [0.9.85](https://github.com/Hufe921/canvas-editor/compare/v0.9.84...v0.9.85) (2024-07-07)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* custom override method removes support for asynchronous #672 ([0e705d6](https://github.com/Hufe921/canvas-editor/commit/0e705d6a0bdb0922efd5c47edd8ca9eba9964199)), closes [#672](https://github.com/Hufe921/canvas-editor/issues/672)
|
|
7
|
+
* set control highlight and re render #678 ([24df9d3](https://github.com/Hufe921/canvas-editor/commit/24df9d3b006a8daf795ada677bfd0159e3ccc3f5)), closes [#678](https://github.com/Hufe921/canvas-editor/issues/678)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Chores
|
|
11
|
+
|
|
12
|
+
* update build.yml ([a40441d](https://github.com/Hufe921/canvas-editor/commit/a40441dc3994a41ae29c341a542be6e0e7dada2e))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* add render mode #667 ([affd191](https://github.com/Hufe921/canvas-editor/commit/affd1911552a73a2b63a13f2c423121637830b99)), closes [#667](https://github.com/Hufe921/canvas-editor/issues/667)
|
|
18
|
+
* add title deletable property #670 ([b3d8413](https://github.com/Hufe921/canvas-editor/commit/b3d8413b35050eac626af1c57beaaf1b8d692a0e)), closes [#670](https://github.com/Hufe921/canvas-editor/issues/670)
|
|
19
|
+
* insert element boundary optimization #669 ([de44bd6](https://github.com/Hufe921/canvas-editor/commit/de44bd68ab01e5ffa8d6a8dc5d566b0cdb8d08e6)), closes [#669](https://github.com/Hufe921/canvas-editor/issues/669)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Tests
|
|
23
|
+
|
|
24
|
+
* update text test case ([c24da73](https://github.com/Hufe921/canvas-editor/commit/c24da737b15200775a7d4a5edf4e2224f6ec5429))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
## [0.9.84](https://github.com/Hufe921/canvas-editor/compare/v0.9.83...v0.9.84) (2024-06-30)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* merge table cell boundary error #661 ([146ac75](https://github.com/Hufe921/canvas-editor/commit/146ac75a002338f13c96900a2849062c29018606)), closes [#661](https://github.com/Hufe921/canvas-editor/issues/661)
|
|
34
|
+
* set default style for control using executeSetControlProperties #658 ([7b5079c](https://github.com/Hufe921/canvas-editor/commit/7b5079c9b638730f7ea609239b3cb91b915d4650)), closes [#658](https://github.com/Hufe921/canvas-editor/issues/658)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
* optimization of table operations in form mode #662 ([b740637](https://github.com/Hufe921/canvas-editor/commit/b74063741f413d5bf6f90c748761f64141405ca7)), closes [#662](https://github.com/Hufe921/canvas-editor/issues/662)
|
|
40
|
+
* override method with default interception behavior #663 ([9a4b4f9](https://github.com/Hufe921/canvas-editor/commit/9a4b4f9a4a70a344740212507e250d9bdea5dd32)), closes [#663](https://github.com/Hufe921/canvas-editor/issues/663)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
1
44
|
## [0.9.83](https://github.com/Hufe921/canvas-editor/compare/v0.9.82...v0.9.83) (2024-06-21)
|
|
2
45
|
|
|
3
46
|
|
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.85";
|
|
27
27
|
var MaxHeightRatio;
|
|
28
28
|
(function(MaxHeightRatio2) {
|
|
29
29
|
MaxHeightRatio2["HALF"] = "half";
|
|
@@ -4351,7 +4351,7 @@ function formatElementContext(sourceElementList, formatElementList2, anchorIndex
|
|
|
4351
4351
|
let isBreakWarped = false;
|
|
4352
4352
|
for (let e = 0; e < formatElementList2.length; e++) {
|
|
4353
4353
|
const targetElement = formatElementList2[e];
|
|
4354
|
-
if (isBreakWhenWrap && !copyElement.listId &&
|
|
4354
|
+
if (isBreakWhenWrap && !copyElement.listId && START_LINE_BREAK_REG.test(targetElement.value)) {
|
|
4355
4355
|
isBreakWarped = true;
|
|
4356
4356
|
}
|
|
4357
4357
|
if (isBreakWarped || !copyElement.listId && targetElement.type === ElementType.LIST) {
|
|
@@ -5066,8 +5066,9 @@ function pasteByEvent(host, evt) {
|
|
|
5066
5066
|
return;
|
|
5067
5067
|
const { paste } = draw.getOverride();
|
|
5068
5068
|
if (paste) {
|
|
5069
|
-
paste(evt);
|
|
5070
|
-
|
|
5069
|
+
const overrideResult = paste(evt);
|
|
5070
|
+
if ((overrideResult == null ? void 0 : overrideResult.preventDefault) !== false)
|
|
5071
|
+
return;
|
|
5071
5072
|
}
|
|
5072
5073
|
if (!getIsClipboardContainFile(clipboardData)) {
|
|
5073
5074
|
const clipboardText = clipboardData.getData("text");
|
|
@@ -5118,8 +5119,9 @@ async function pasteByApi(host, options) {
|
|
|
5118
5119
|
return;
|
|
5119
5120
|
const { paste } = draw.getOverride();
|
|
5120
5121
|
if (paste) {
|
|
5121
|
-
paste();
|
|
5122
|
-
|
|
5122
|
+
const overrideResult = paste();
|
|
5123
|
+
if ((overrideResult == null ? void 0 : overrideResult.preventDefault) !== false)
|
|
5124
|
+
return;
|
|
5123
5125
|
}
|
|
5124
5126
|
const clipboardText = await navigator.clipboard.readText();
|
|
5125
5127
|
const editorClipboardData = getClipboardData();
|
|
@@ -5353,6 +5355,56 @@ class Cursor {
|
|
|
5353
5355
|
}
|
|
5354
5356
|
}
|
|
5355
5357
|
}
|
|
5358
|
+
var EditorComponent;
|
|
5359
|
+
(function(EditorComponent2) {
|
|
5360
|
+
EditorComponent2["COMPONENT"] = "component";
|
|
5361
|
+
EditorComponent2["MENU"] = "menu";
|
|
5362
|
+
EditorComponent2["MAIN"] = "main";
|
|
5363
|
+
EditorComponent2["FOOTER"] = "footer";
|
|
5364
|
+
EditorComponent2["CONTEXTMENU"] = "contextmenu";
|
|
5365
|
+
EditorComponent2["POPUP"] = "popup";
|
|
5366
|
+
EditorComponent2["CATALOG"] = "catalog";
|
|
5367
|
+
EditorComponent2["COMMENT"] = "comment";
|
|
5368
|
+
})(EditorComponent || (EditorComponent = {}));
|
|
5369
|
+
var EditorContext;
|
|
5370
|
+
(function(EditorContext2) {
|
|
5371
|
+
EditorContext2["PAGE"] = "page";
|
|
5372
|
+
EditorContext2["TABLE"] = "table";
|
|
5373
|
+
})(EditorContext || (EditorContext = {}));
|
|
5374
|
+
var EditorMode;
|
|
5375
|
+
(function(EditorMode2) {
|
|
5376
|
+
EditorMode2["EDIT"] = "edit";
|
|
5377
|
+
EditorMode2["CLEAN"] = "clean";
|
|
5378
|
+
EditorMode2["READONLY"] = "readonly";
|
|
5379
|
+
EditorMode2["FORM"] = "form";
|
|
5380
|
+
EditorMode2["PRINT"] = "print";
|
|
5381
|
+
})(EditorMode || (EditorMode = {}));
|
|
5382
|
+
var EditorZone;
|
|
5383
|
+
(function(EditorZone2) {
|
|
5384
|
+
EditorZone2["HEADER"] = "header";
|
|
5385
|
+
EditorZone2["MAIN"] = "main";
|
|
5386
|
+
EditorZone2["FOOTER"] = "footer";
|
|
5387
|
+
})(EditorZone || (EditorZone = {}));
|
|
5388
|
+
var PageMode;
|
|
5389
|
+
(function(PageMode2) {
|
|
5390
|
+
PageMode2["PAGING"] = "paging";
|
|
5391
|
+
PageMode2["CONTINUITY"] = "continuity";
|
|
5392
|
+
})(PageMode || (PageMode = {}));
|
|
5393
|
+
var PaperDirection;
|
|
5394
|
+
(function(PaperDirection2) {
|
|
5395
|
+
PaperDirection2["VERTICAL"] = "vertical";
|
|
5396
|
+
PaperDirection2["HORIZONTAL"] = "horizontal";
|
|
5397
|
+
})(PaperDirection || (PaperDirection = {}));
|
|
5398
|
+
var WordBreak;
|
|
5399
|
+
(function(WordBreak2) {
|
|
5400
|
+
WordBreak2["BREAK_ALL"] = "break-all";
|
|
5401
|
+
WordBreak2["BREAK_WORD"] = "break-word";
|
|
5402
|
+
})(WordBreak || (WordBreak = {}));
|
|
5403
|
+
var RenderMode;
|
|
5404
|
+
(function(RenderMode2) {
|
|
5405
|
+
RenderMode2["SPEED"] = "speed";
|
|
5406
|
+
RenderMode2["COMPATIBILITY"] = "compatibility";
|
|
5407
|
+
})(RenderMode || (RenderMode = {}));
|
|
5356
5408
|
var MouseEventButton;
|
|
5357
5409
|
(function(MouseEventButton2) {
|
|
5358
5410
|
MouseEventButton2[MouseEventButton2["LEFT"] = 0] = "LEFT";
|
|
@@ -5690,10 +5742,14 @@ function mousedown(evt, host) {
|
|
|
5690
5742
|
const previewer = draw.getPreviewer();
|
|
5691
5743
|
previewer.clearResizer();
|
|
5692
5744
|
if (isDirectHitImage) {
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5745
|
+
const previewerDrawOption = {
|
|
5746
|
+
dragDisable: isReadonly || !curElement.controlId && draw.getMode() === EditorMode.FORM
|
|
5747
|
+
};
|
|
5748
|
+
if (curElement.type === ElementType.LATEX) {
|
|
5749
|
+
previewerDrawOption.mime = "svg";
|
|
5750
|
+
previewerDrawOption.srcKey = "laTexSVG";
|
|
5751
|
+
}
|
|
5752
|
+
previewer.drawResizer(curElement, positionList[curIndex], previewerDrawOption);
|
|
5697
5753
|
draw.getCursor().drawCursor({
|
|
5698
5754
|
isShow: false
|
|
5699
5755
|
});
|
|
@@ -5704,7 +5760,7 @@ function mousedown(evt, host) {
|
|
|
5704
5760
|
}
|
|
5705
5761
|
const tableTool = draw.getTableTool();
|
|
5706
5762
|
tableTool.dispose();
|
|
5707
|
-
if (isTable && !isReadonly) {
|
|
5763
|
+
if (isTable && !isReadonly && draw.getMode() !== EditorMode.FORM) {
|
|
5708
5764
|
tableTool.render();
|
|
5709
5765
|
}
|
|
5710
5766
|
const hyperlinkParticle = draw.getHyperlinkParticle();
|
|
@@ -5991,51 +6047,6 @@ function mousemove(evt, host) {
|
|
|
5991
6047
|
isCompute: false
|
|
5992
6048
|
});
|
|
5993
6049
|
}
|
|
5994
|
-
var EditorComponent;
|
|
5995
|
-
(function(EditorComponent2) {
|
|
5996
|
-
EditorComponent2["COMPONENT"] = "component";
|
|
5997
|
-
EditorComponent2["MENU"] = "menu";
|
|
5998
|
-
EditorComponent2["MAIN"] = "main";
|
|
5999
|
-
EditorComponent2["FOOTER"] = "footer";
|
|
6000
|
-
EditorComponent2["CONTEXTMENU"] = "contextmenu";
|
|
6001
|
-
EditorComponent2["POPUP"] = "popup";
|
|
6002
|
-
EditorComponent2["CATALOG"] = "catalog";
|
|
6003
|
-
EditorComponent2["COMMENT"] = "comment";
|
|
6004
|
-
})(EditorComponent || (EditorComponent = {}));
|
|
6005
|
-
var EditorContext;
|
|
6006
|
-
(function(EditorContext2) {
|
|
6007
|
-
EditorContext2["PAGE"] = "page";
|
|
6008
|
-
EditorContext2["TABLE"] = "table";
|
|
6009
|
-
})(EditorContext || (EditorContext = {}));
|
|
6010
|
-
var EditorMode;
|
|
6011
|
-
(function(EditorMode2) {
|
|
6012
|
-
EditorMode2["EDIT"] = "edit";
|
|
6013
|
-
EditorMode2["CLEAN"] = "clean";
|
|
6014
|
-
EditorMode2["READONLY"] = "readonly";
|
|
6015
|
-
EditorMode2["FORM"] = "form";
|
|
6016
|
-
EditorMode2["PRINT"] = "print";
|
|
6017
|
-
})(EditorMode || (EditorMode = {}));
|
|
6018
|
-
var EditorZone;
|
|
6019
|
-
(function(EditorZone2) {
|
|
6020
|
-
EditorZone2["HEADER"] = "header";
|
|
6021
|
-
EditorZone2["MAIN"] = "main";
|
|
6022
|
-
EditorZone2["FOOTER"] = "footer";
|
|
6023
|
-
})(EditorZone || (EditorZone = {}));
|
|
6024
|
-
var PageMode;
|
|
6025
|
-
(function(PageMode2) {
|
|
6026
|
-
PageMode2["PAGING"] = "paging";
|
|
6027
|
-
PageMode2["CONTINUITY"] = "continuity";
|
|
6028
|
-
})(PageMode || (PageMode = {}));
|
|
6029
|
-
var PaperDirection;
|
|
6030
|
-
(function(PaperDirection2) {
|
|
6031
|
-
PaperDirection2["VERTICAL"] = "vertical";
|
|
6032
|
-
PaperDirection2["HORIZONTAL"] = "horizontal";
|
|
6033
|
-
})(PaperDirection || (PaperDirection = {}));
|
|
6034
|
-
var WordBreak;
|
|
6035
|
-
(function(WordBreak2) {
|
|
6036
|
-
WordBreak2["BREAK_ALL"] = "break-all";
|
|
6037
|
-
WordBreak2["BREAK_WORD"] = "break-word";
|
|
6038
|
-
})(WordBreak || (WordBreak = {}));
|
|
6039
6050
|
function backspace(evt, host) {
|
|
6040
6051
|
const draw = host.getDraw();
|
|
6041
6052
|
if (draw.isReadonly())
|
|
@@ -6156,8 +6167,10 @@ function enter(evt, host) {
|
|
|
6156
6167
|
if (evt.shiftKey && startElement.listId) {
|
|
6157
6168
|
enterText.listWrap = true;
|
|
6158
6169
|
}
|
|
6170
|
+
formatElementContext(elementList, [enterText], startIndex, {
|
|
6171
|
+
isBreakWhenWrap: true
|
|
6172
|
+
});
|
|
6159
6173
|
if (!(endElement.titleId && endElement.titleId !== ((_b = elementList[endIndex + 1]) == null ? void 0 : _b.titleId))) {
|
|
6160
|
-
formatElementContext(elementList, [enterText], startIndex);
|
|
6161
6174
|
const copyElement = getAnchorElement(elementList, endIndex);
|
|
6162
6175
|
if (copyElement) {
|
|
6163
6176
|
const copyAttr = [...EDITOR_ROW_ATTR];
|
|
@@ -6976,8 +6989,9 @@ function copy(host) {
|
|
|
6976
6989
|
const draw = host.getDraw();
|
|
6977
6990
|
const { copy: copy2 } = draw.getOverride();
|
|
6978
6991
|
if (copy2) {
|
|
6979
|
-
copy2();
|
|
6980
|
-
|
|
6992
|
+
const overrideResult = copy2();
|
|
6993
|
+
if ((overrideResult == null ? void 0 : overrideResult.preventDefault) !== false)
|
|
6994
|
+
return;
|
|
6981
6995
|
}
|
|
6982
6996
|
const rangeManager = draw.getRange();
|
|
6983
6997
|
let copyElementList = null;
|
|
@@ -7028,8 +7042,9 @@ function drop(evt, host) {
|
|
|
7028
7042
|
const draw = host.getDraw();
|
|
7029
7043
|
const { drop: drop2 } = draw.getOverride();
|
|
7030
7044
|
if (drop2) {
|
|
7031
|
-
drop2(evt);
|
|
7032
|
-
|
|
7045
|
+
const overrideResult = drop2(evt);
|
|
7046
|
+
if ((overrideResult == null ? void 0 : overrideResult.preventDefault) !== false)
|
|
7047
|
+
return;
|
|
7033
7048
|
}
|
|
7034
7049
|
evt.preventDefault();
|
|
7035
7050
|
const data2 = (_a = evt.dataTransfer) == null ? void 0 : _a.getData("text");
|
|
@@ -9238,6 +9253,14 @@ class TextParticle {
|
|
|
9238
9253
|
}
|
|
9239
9254
|
record(ctx, element, x, y) {
|
|
9240
9255
|
this.ctx = ctx;
|
|
9256
|
+
if (this.options.renderMode === RenderMode.COMPATIBILITY) {
|
|
9257
|
+
this._setCurXY(x, y);
|
|
9258
|
+
this.text = element.value;
|
|
9259
|
+
this.curStyle = element.style;
|
|
9260
|
+
this.curColor = element.color;
|
|
9261
|
+
this.complete();
|
|
9262
|
+
return;
|
|
9263
|
+
}
|
|
9241
9264
|
if (!this.text) {
|
|
9242
9265
|
this._setCurXY(x, y);
|
|
9243
9266
|
}
|
|
@@ -9768,6 +9791,8 @@ class TableParticle {
|
|
|
9768
9791
|
td.height = height;
|
|
9769
9792
|
td.rowIndex = t;
|
|
9770
9793
|
td.colIndex = colIndex;
|
|
9794
|
+
td.trIndex = t;
|
|
9795
|
+
td.tdIndex = d;
|
|
9771
9796
|
preX += width;
|
|
9772
9797
|
if (isLastRowTd && !isLastTd) {
|
|
9773
9798
|
preX = 0;
|
|
@@ -12327,6 +12352,12 @@ class Control {
|
|
|
12327
12352
|
element.control = __spreadProps(__spreadValues(__spreadValues({}, element.control), properties), {
|
|
12328
12353
|
value: element.control.value
|
|
12329
12354
|
});
|
|
12355
|
+
CONTROL_STYLE_ATTR.forEach((key) => {
|
|
12356
|
+
const controlStyleProperty = properties[key];
|
|
12357
|
+
if (controlStyleProperty) {
|
|
12358
|
+
Reflect.set(element, key, controlStyleProperty);
|
|
12359
|
+
}
|
|
12360
|
+
});
|
|
12330
12361
|
let newEndIndex = i;
|
|
12331
12362
|
while (newEndIndex < elementList.length) {
|
|
12332
12363
|
const nextElement = elementList[newEndIndex];
|
|
@@ -12937,7 +12968,7 @@ class Previewer {
|
|
|
12937
12968
|
document.addEventListener("mousemove", mousemoveFn);
|
|
12938
12969
|
document.addEventListener("mouseup", () => {
|
|
12939
12970
|
var _a;
|
|
12940
|
-
if (this.curElement) {
|
|
12971
|
+
if (this.curElement && !this.previewerDrawOption.dragDisable) {
|
|
12941
12972
|
this.curElement.width = this.width;
|
|
12942
12973
|
this.curElement.height = this.height;
|
|
12943
12974
|
this.draw.render({
|
|
@@ -12955,7 +12986,7 @@ class Previewer {
|
|
|
12955
12986
|
evt.preventDefault();
|
|
12956
12987
|
}
|
|
12957
12988
|
_mousemove(evt) {
|
|
12958
|
-
if (!this.curElement)
|
|
12989
|
+
if (!this.curElement || this.previewerDrawOption.dragDisable)
|
|
12959
12990
|
return;
|
|
12960
12991
|
const { scale } = this.options;
|
|
12961
12992
|
let dx = 0;
|
|
@@ -14630,6 +14661,7 @@ class Draw {
|
|
|
14630
14661
|
this.setEditorData(this.printModeData);
|
|
14631
14662
|
this.printModeData = null;
|
|
14632
14663
|
}
|
|
14664
|
+
this.clearSideEffect();
|
|
14633
14665
|
this.range.clearRange();
|
|
14634
14666
|
this.mode = payload;
|
|
14635
14667
|
this.render({
|
|
@@ -14930,7 +14962,8 @@ class Draw {
|
|
|
14930
14962
|
if (!this.control.getActiveControl()) {
|
|
14931
14963
|
let deleteIndex = endIndex - 1;
|
|
14932
14964
|
while (deleteIndex >= start) {
|
|
14933
|
-
|
|
14965
|
+
const deleteElement = elementList[deleteIndex];
|
|
14966
|
+
if (((_b = deleteElement == null ? void 0 : deleteElement.control) == null ? void 0 : _b.deletable) !== false && ((_c = deleteElement == null ? void 0 : deleteElement.title) == null ? void 0 : _c.deletable) !== false) {
|
|
14934
14967
|
elementList.splice(deleteIndex, 1);
|
|
14935
14968
|
}
|
|
14936
14969
|
deleteIndex--;
|
|
@@ -16582,6 +16615,7 @@ function mergeOption(options = {}) {
|
|
|
16582
16615
|
marginIndicatorColor: "#BABABA",
|
|
16583
16616
|
margins: [100, 120, 100, 120],
|
|
16584
16617
|
pageMode: PageMode.PAGING,
|
|
16618
|
+
renderMode: RenderMode.SPEED,
|
|
16585
16619
|
defaultHyperlinkColor: "#0000FF",
|
|
16586
16620
|
paperDirection: PaperDirection.VERTICAL,
|
|
16587
16621
|
inactiveAlpha: 0.6,
|
|
@@ -17775,7 +17809,11 @@ class CommandAdapt {
|
|
|
17775
17809
|
d++;
|
|
17776
17810
|
}
|
|
17777
17811
|
}
|
|
17778
|
-
|
|
17812
|
+
this.position.setPositionContext(__spreadProps(__spreadValues({}, positionContext), {
|
|
17813
|
+
trIndex: anchorTd.trIndex,
|
|
17814
|
+
tdIndex: anchorTd.tdIndex
|
|
17815
|
+
}));
|
|
17816
|
+
const curIndex = anchorTd.value.length - 1;
|
|
17779
17817
|
this.range.setRange(curIndex, curIndex);
|
|
17780
17818
|
this.draw.render();
|
|
17781
17819
|
this.tableTool.render();
|
|
@@ -18591,7 +18629,9 @@ class CommandAdapt {
|
|
|
18591
18629
|
const cloneElementList = deepClone(payload);
|
|
18592
18630
|
const { startIndex } = this.range.getRange();
|
|
18593
18631
|
const elementList = this.draw.getElementList();
|
|
18594
|
-
formatElementContext(elementList, cloneElementList, startIndex
|
|
18632
|
+
formatElementContext(elementList, cloneElementList, startIndex, {
|
|
18633
|
+
isBreakWhenWrap: true
|
|
18634
|
+
});
|
|
18595
18635
|
this.draw.insertElementList(cloneElementList);
|
|
18596
18636
|
}
|
|
18597
18637
|
appendElementList(elementList, options) {
|
|
@@ -18783,6 +18823,9 @@ class CommandAdapt {
|
|
|
18783
18823
|
}
|
|
18784
18824
|
setControlHighlight(payload) {
|
|
18785
18825
|
this.draw.getControl().setHighlightList(payload);
|
|
18826
|
+
this.draw.render({
|
|
18827
|
+
isSubmitHistory: false
|
|
18828
|
+
});
|
|
18786
18829
|
}
|
|
18787
18830
|
updateOptions(payload) {
|
|
18788
18831
|
const newOption = mergeOption(payload);
|
|
@@ -19098,7 +19141,7 @@ const controlMenus = [
|
|
|
19098
19141
|
i18nPath: "contextmenu.control.delete",
|
|
19099
19142
|
when: (payload) => {
|
|
19100
19143
|
var _a;
|
|
19101
|
-
return !payload.isReadonly && !payload.editorHasSelection && !!((_a = payload.startElement) == null ? void 0 : _a.controlId);
|
|
19144
|
+
return !payload.isReadonly && !payload.editorHasSelection && !!((_a = payload.startElement) == null ? void 0 : _a.controlId) && payload.options.mode !== EditorMode.FORM;
|
|
19102
19145
|
},
|
|
19103
19146
|
callback: (command) => {
|
|
19104
19147
|
command.executeRemoveControl();
|
|
@@ -19295,7 +19338,7 @@ const tableMenus = [
|
|
|
19295
19338
|
i18nPath: "contextmenu.table.border",
|
|
19296
19339
|
icon: "border-all",
|
|
19297
19340
|
when: (payload) => {
|
|
19298
|
-
return !payload.isReadonly && payload.isInTable;
|
|
19341
|
+
return !payload.isReadonly && payload.isInTable && payload.options.mode !== EditorMode.FORM;
|
|
19299
19342
|
},
|
|
19300
19343
|
childMenus: [
|
|
19301
19344
|
{
|
|
@@ -19394,7 +19437,7 @@ const tableMenus = [
|
|
|
19394
19437
|
i18nPath: "contextmenu.table.verticalAlign",
|
|
19395
19438
|
icon: "vertical-align",
|
|
19396
19439
|
when: (payload) => {
|
|
19397
|
-
return !payload.isReadonly && payload.isInTable;
|
|
19440
|
+
return !payload.isReadonly && payload.isInTable && payload.options.mode !== EditorMode.FORM;
|
|
19398
19441
|
},
|
|
19399
19442
|
childMenus: [
|
|
19400
19443
|
{
|
|
@@ -19431,7 +19474,7 @@ const tableMenus = [
|
|
|
19431
19474
|
i18nPath: "contextmenu.table.insertRowCol",
|
|
19432
19475
|
icon: "insert-row-col",
|
|
19433
19476
|
when: (payload) => {
|
|
19434
|
-
return !payload.isReadonly && payload.isInTable;
|
|
19477
|
+
return !payload.isReadonly && payload.isInTable && payload.options.mode !== EditorMode.FORM;
|
|
19435
19478
|
},
|
|
19436
19479
|
childMenus: [
|
|
19437
19480
|
{
|
|
@@ -19477,7 +19520,7 @@ const tableMenus = [
|
|
|
19477
19520
|
i18nPath: "contextmenu.table.deleteRowCol",
|
|
19478
19521
|
icon: "delete-row-col",
|
|
19479
19522
|
when: (payload) => {
|
|
19480
|
-
return !payload.isReadonly && payload.isInTable;
|
|
19523
|
+
return !payload.isReadonly && payload.isInTable && payload.options.mode !== EditorMode.FORM;
|
|
19481
19524
|
},
|
|
19482
19525
|
childMenus: [
|
|
19483
19526
|
{
|
|
@@ -19514,7 +19557,7 @@ const tableMenus = [
|
|
|
19514
19557
|
i18nPath: "contextmenu.table.mergeCell",
|
|
19515
19558
|
icon: "merge-cell",
|
|
19516
19559
|
when: (payload) => {
|
|
19517
|
-
return !payload.isReadonly && payload.isCrossRowCol;
|
|
19560
|
+
return !payload.isReadonly && payload.isCrossRowCol && payload.options.mode !== EditorMode.FORM;
|
|
19518
19561
|
},
|
|
19519
19562
|
callback: (command) => {
|
|
19520
19563
|
command.executeMergeTableCell();
|
|
@@ -19525,7 +19568,7 @@ const tableMenus = [
|
|
|
19525
19568
|
i18nPath: "contextmenu.table.mergeCancelCell",
|
|
19526
19569
|
icon: "merge-cancel-cell",
|
|
19527
19570
|
when: (payload) => {
|
|
19528
|
-
return !payload.isReadonly && payload.isInTable;
|
|
19571
|
+
return !payload.isReadonly && payload.isInTable && payload.options.mode !== EditorMode.FORM;
|
|
19529
19572
|
},
|
|
19530
19573
|
callback: (command) => {
|
|
19531
19574
|
command.executeCancelMergeTableCell();
|
|
@@ -19647,7 +19690,8 @@ class ContextMenu {
|
|
|
19647
19690
|
isInTable: isTable,
|
|
19648
19691
|
trIndex: trIndex != null ? trIndex : null,
|
|
19649
19692
|
tdIndex: tdIndex != null ? tdIndex : null,
|
|
19650
|
-
tableElement
|
|
19693
|
+
tableElement,
|
|
19694
|
+
options: this.options
|
|
19651
19695
|
};
|
|
19652
19696
|
}
|
|
19653
19697
|
_createContextMenuContainer() {
|
|
@@ -20126,5 +20170,5 @@ class Editor {
|
|
|
20126
20170
|
this.use = plugin.use.bind(plugin);
|
|
20127
20171
|
}
|
|
20128
20172
|
}
|
|
20129
|
-
export { BackgroundRepeat, BackgroundSize, BlockType, Command, ControlIndentation, ControlType, EDITOR_COMPONENT, Editor, EditorComponent, EditorMode, EditorZone, ElementType, INTERNAL_CONTEXT_MENU_KEY, ImageDisplay, KeyMap, LETTER_CLASS, ListStyle, ListType, MaxHeightRatio, NumberType, PageMode, PaperDirection, RowFlex, TableBorder, TdBorder, TdSlash, TextDecorationStyle, TitleLevel, VerticalAlign, WordBreak, Editor as default, splitText };
|
|
20173
|
+
export { BackgroundRepeat, BackgroundSize, BlockType, Command, ControlIndentation, ControlType, EDITOR_COMPONENT, Editor, EditorComponent, EditorMode, EditorZone, ElementType, INTERNAL_CONTEXT_MENU_KEY, ImageDisplay, KeyMap, LETTER_CLASS, ListStyle, ListType, MaxHeightRatio, NumberType, PageMode, PaperDirection, RenderMode, RowFlex, TableBorder, TdBorder, TdSlash, TextDecorationStyle, TitleLevel, VerticalAlign, WordBreak, Editor as default, splitText };
|
|
20130
20174
|
//# sourceMappingURL=canvas-editor.es.js.map
|