@hufe921/canvas-editor 0.9.87 → 0.9.88
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 +22 -0
- package/dist/canvas-editor.es.js +96 -56
- 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/command/CommandAdapt.d.ts +2 -2
- package/dist/src/editor/core/draw/Draw.d.ts +3 -2
- package/dist/src/editor/interface/Background.d.ts +1 -0
- package/dist/src/editor/interface/Editor.d.ts +3 -0
- package/dist/src/editor/interface/Title.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## [0.9.88](https://github.com/Hufe921/canvas-editor/compare/v0.9.87...v0.9.88) (2024-08-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* float image position boundary error #716 ([f5113f5](https://github.com/Hufe921/canvas-editor/commit/f5113f539c5b224fdb9af8cde8e61f632dc7e49f)), closes [#716](https://github.com/Hufe921/canvas-editor/issues/716)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Chores
|
|
10
|
+
|
|
11
|
+
* add touch support to signature component ([c3ef290](https://github.com/Hufe921/canvas-editor/commit/c3ef2907ae31be21cd3bc61a5600ad381230034f))
|
|
12
|
+
* update issue template ([eea301e](https://github.com/Hufe921/canvas-editor/commit/eea301eb11fdc3d5870da2408abccf4d96d8532f))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* add applyPageNumbers attribute to background option #729 ([8d112a8](https://github.com/Hufe921/canvas-editor/commit/8d112a8518656edd14201cb9bd16a417752fcdf9)), closes [#729](https://github.com/Hufe921/canvas-editor/issues/729)
|
|
18
|
+
* add cursor setting option to executeSetValue api #715 ([3235e5a](https://github.com/Hufe921/canvas-editor/commit/3235e5ae386bd1f48f5f64427e1eb0ed3782838d)), closes [#715](https://github.com/Hufe921/canvas-editor/issues/715)
|
|
19
|
+
* add title disabled property #680 ([87a8dbe](https://github.com/Hufe921/canvas-editor/commit/87a8dbea1596bcdee28edbb58b02fbe2a36e6c58)), closes [#680](https://github.com/Hufe921/canvas-editor/issues/680)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
1
23
|
## [0.9.87](https://github.com/Hufe921/canvas-editor/compare/v0.9.86...v0.9.87) (2024-07-26)
|
|
2
24
|
|
|
3
25
|
|
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.88";
|
|
27
27
|
var MaxHeightRatio;
|
|
28
28
|
(function(MaxHeightRatio2) {
|
|
29
29
|
MaxHeightRatio2["HALF"] = "half";
|
|
@@ -4343,10 +4343,13 @@ function getAnchorElement(elementList, anchorIndex) {
|
|
|
4343
4343
|
return !anchorElement.listId && anchorElement.value === ZERO && anchorNextElement && anchorNextElement.value !== ZERO ? anchorNextElement : anchorElement;
|
|
4344
4344
|
}
|
|
4345
4345
|
function formatElementContext(sourceElementList, formatElementList2, anchorIndex, options) {
|
|
4346
|
-
var _a, _b;
|
|
4347
|
-
|
|
4346
|
+
var _a, _b, _c;
|
|
4347
|
+
let copyElement = getAnchorElement(sourceElementList, anchorIndex);
|
|
4348
4348
|
if (!copyElement)
|
|
4349
4349
|
return;
|
|
4350
|
+
if ((_a = copyElement.title) == null ? void 0 : _a.disabled) {
|
|
4351
|
+
copyElement = omitObject(copyElement, TITLE_CONTEXT_ATTR);
|
|
4352
|
+
}
|
|
4350
4353
|
const { isBreakWhenWrap = false } = options || {};
|
|
4351
4354
|
let isBreakWarped = false;
|
|
4352
4355
|
for (let e = 0; e < formatElementList2.length; e++) {
|
|
@@ -4357,12 +4360,12 @@ function formatElementContext(sourceElementList, formatElementList2, anchorIndex
|
|
|
4357
4360
|
if (isBreakWarped || !copyElement.listId && targetElement.type === ElementType.LIST) {
|
|
4358
4361
|
const cloneAttr = [...TABLE_CONTEXT_ATTR, ...EDITOR_ROW_ATTR];
|
|
4359
4362
|
cloneProperty(cloneAttr, copyElement, targetElement);
|
|
4360
|
-
(
|
|
4363
|
+
(_b = targetElement.valueList) == null ? void 0 : _b.forEach((valueItem) => {
|
|
4361
4364
|
cloneProperty(cloneAttr, copyElement, valueItem);
|
|
4362
4365
|
});
|
|
4363
4366
|
continue;
|
|
4364
4367
|
}
|
|
4365
|
-
if ((
|
|
4368
|
+
if ((_c = targetElement.valueList) == null ? void 0 : _c.length) {
|
|
4366
4369
|
formatElementContext(sourceElementList, targetElement.valueList, anchorIndex);
|
|
4367
4370
|
}
|
|
4368
4371
|
cloneProperty(EDITOR_ELEMENT_CONTEXT_ATTR, copyElement, targetElement);
|
|
@@ -4980,8 +4983,7 @@ function getIsClipboardContainFile(clipboardData) {
|
|
|
4980
4983
|
}
|
|
4981
4984
|
function pasteElement(host, elementList) {
|
|
4982
4985
|
const draw = host.getDraw();
|
|
4983
|
-
|
|
4984
|
-
if (isReadonly)
|
|
4986
|
+
if (draw.isReadonly() || draw.isDisabled())
|
|
4985
4987
|
return;
|
|
4986
4988
|
const rangeManager = draw.getRange();
|
|
4987
4989
|
const { startIndex } = rangeManager.getRange();
|
|
@@ -5020,8 +5022,7 @@ function pasteElement(host, elementList) {
|
|
|
5020
5022
|
}
|
|
5021
5023
|
function pasteHTML(host, htmlText) {
|
|
5022
5024
|
const draw = host.getDraw();
|
|
5023
|
-
|
|
5024
|
-
if (isReadonly)
|
|
5025
|
+
if (draw.isReadonly() || draw.isDisabled())
|
|
5025
5026
|
return;
|
|
5026
5027
|
const elementList = getElementListByHTML(htmlText, {
|
|
5027
5028
|
innerWidth: draw.getOriginalInnerWidth()
|
|
@@ -5030,8 +5031,7 @@ function pasteHTML(host, htmlText) {
|
|
|
5030
5031
|
}
|
|
5031
5032
|
function pasteImage(host, file) {
|
|
5032
5033
|
const draw = host.getDraw();
|
|
5033
|
-
|
|
5034
|
-
if (isReadonly)
|
|
5034
|
+
if (draw.isReadonly() || draw.isDisabled())
|
|
5035
5035
|
return;
|
|
5036
5036
|
const rangeManager = draw.getRange();
|
|
5037
5037
|
const { startIndex } = rangeManager.getRange();
|
|
@@ -5058,8 +5058,7 @@ function pasteImage(host, file) {
|
|
|
5058
5058
|
}
|
|
5059
5059
|
function pasteByEvent(host, evt) {
|
|
5060
5060
|
const draw = host.getDraw();
|
|
5061
|
-
|
|
5062
|
-
if (isReadonly)
|
|
5061
|
+
if (draw.isReadonly() || draw.isDisabled())
|
|
5063
5062
|
return;
|
|
5064
5063
|
const clipboardData = evt.clipboardData;
|
|
5065
5064
|
if (!clipboardData)
|
|
@@ -5114,8 +5113,7 @@ function pasteByEvent(host, evt) {
|
|
|
5114
5113
|
}
|
|
5115
5114
|
async function pasteByApi(host, options) {
|
|
5116
5115
|
const draw = host.getDraw();
|
|
5117
|
-
|
|
5118
|
-
if (isReadonly)
|
|
5116
|
+
if (draw.isReadonly() || draw.isDisabled())
|
|
5119
5117
|
return;
|
|
5120
5118
|
const { paste } = draw.getOverride();
|
|
5121
5119
|
if (paste) {
|
|
@@ -5804,8 +5802,10 @@ function mouseup(evt, host) {
|
|
|
5804
5802
|
var _a, _b, _c, _d;
|
|
5805
5803
|
if (host.isAllowDrop) {
|
|
5806
5804
|
const draw = host.getDraw();
|
|
5807
|
-
if (draw.isReadonly())
|
|
5805
|
+
if (draw.isReadonly() || draw.isDisabled()) {
|
|
5806
|
+
host.mousedown(evt);
|
|
5808
5807
|
return;
|
|
5808
|
+
}
|
|
5809
5809
|
const position = draw.getPosition();
|
|
5810
5810
|
const positionList = position.getPositionList();
|
|
5811
5811
|
const positionContext = position.getPositionContext();
|
|
@@ -6908,7 +6908,7 @@ function keydown(evt, host) {
|
|
|
6908
6908
|
function input(data2, host) {
|
|
6909
6909
|
var _a;
|
|
6910
6910
|
const draw = host.getDraw();
|
|
6911
|
-
if (draw.isReadonly())
|
|
6911
|
+
if (draw.isReadonly() || draw.isDisabled())
|
|
6912
6912
|
return;
|
|
6913
6913
|
const position = draw.getPosition();
|
|
6914
6914
|
const cursorPosition = position.getCursorPosition();
|
|
@@ -6934,22 +6934,25 @@ function input(data2, host) {
|
|
|
6934
6934
|
if (!copyElement)
|
|
6935
6935
|
return;
|
|
6936
6936
|
const inputData = splitText(text).map((value) => {
|
|
6937
|
+
var _a2, _b;
|
|
6937
6938
|
const newElement = {
|
|
6938
6939
|
value
|
|
6939
6940
|
};
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6941
|
+
if (!((_a2 = copyElement.title) == null ? void 0 : _a2.disabled) && !((_b = copyElement.control) == null ? void 0 : _b.disabled)) {
|
|
6942
|
+
const nextElement = elementList[endIndex + 1];
|
|
6943
|
+
if (!copyElement.type || copyElement.type === TEXT || 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) {
|
|
6944
|
+
EDITOR_ELEMENT_COPY_ATTR.forEach((attr) => {
|
|
6945
|
+
if (attr === "groupIds" && !(nextElement == null ? void 0 : nextElement.groupIds))
|
|
6946
|
+
return;
|
|
6947
|
+
const value2 = copyElement[attr];
|
|
6948
|
+
if (value2 !== void 0) {
|
|
6949
|
+
newElement[attr] = value2;
|
|
6950
|
+
}
|
|
6951
|
+
});
|
|
6952
|
+
}
|
|
6953
|
+
if (isComposing) {
|
|
6954
|
+
newElement.underline = true;
|
|
6955
|
+
}
|
|
6953
6956
|
}
|
|
6954
6957
|
return newElement;
|
|
6955
6958
|
});
|
|
@@ -7408,6 +7411,9 @@ class CanvasEvent {
|
|
|
7408
7411
|
const painterStyle = this.draw.getPainterStyle();
|
|
7409
7412
|
if (!painterStyle)
|
|
7410
7413
|
return;
|
|
7414
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
7415
|
+
if (isDisabled)
|
|
7416
|
+
return;
|
|
7411
7417
|
const selection = this.range.getSelection();
|
|
7412
7418
|
if (!selection)
|
|
7413
7419
|
return;
|
|
@@ -8125,11 +8131,13 @@ class Position {
|
|
|
8125
8131
|
};
|
|
8126
8132
|
}
|
|
8127
8133
|
getFloatPositionByXY(payload) {
|
|
8134
|
+
var _a;
|
|
8128
8135
|
const { x, y } = payload;
|
|
8136
|
+
const currentPageNo = (_a = payload.pageNo) != null ? _a : this.draw.getPageNo();
|
|
8129
8137
|
const currentZone = this.draw.getZone().getZone();
|
|
8130
8138
|
for (let f = 0; f < this.floatPositionList.length; f++) {
|
|
8131
|
-
const { position, element, isTable, index: index2, trIndex, tdIndex, tdValueIndex, zone: floatElementZone } = this.floatPositionList[f];
|
|
8132
|
-
if (element.type === ElementType.IMAGE && element.imgDisplay === payload.imgDisplay && (!floatElementZone || floatElementZone === currentZone)) {
|
|
8139
|
+
const { position, element, isTable, index: index2, trIndex, tdIndex, tdValueIndex, zone: floatElementZone, pageNo } = this.floatPositionList[f];
|
|
8140
|
+
if (currentPageNo === pageNo && element.type === ElementType.IMAGE && element.imgDisplay === payload.imgDisplay && (!floatElementZone || floatElementZone === currentZone)) {
|
|
8133
8141
|
const imgFloatPosition = element.imgFloatPosition;
|
|
8134
8142
|
if (x >= imgFloatPosition.x && x <= imgFloatPosition.x + element.width && y >= imgFloatPosition.y && y <= imgFloatPosition.y + element.height) {
|
|
8135
8143
|
if (isTable) {
|
|
@@ -8755,14 +8763,14 @@ class Background {
|
|
|
8755
8763
|
}
|
|
8756
8764
|
}
|
|
8757
8765
|
render(ctx, pageNo) {
|
|
8758
|
-
const { background } = this.options;
|
|
8759
|
-
if (
|
|
8766
|
+
const { background: { image, color, applyPageNumbers } } = this.options;
|
|
8767
|
+
if (image && (!(applyPageNumbers == null ? void 0 : applyPageNumbers.length) || applyPageNumbers.includes(pageNo))) {
|
|
8760
8768
|
const { width, height } = this.options;
|
|
8761
8769
|
this._renderBackgroundImage(ctx, width, height);
|
|
8762
8770
|
} else {
|
|
8763
8771
|
const width = this.draw.getCanvasWidth(pageNo);
|
|
8764
8772
|
const height = this.draw.getCanvasHeight(pageNo);
|
|
8765
|
-
this._renderBackgroundColor(ctx,
|
|
8773
|
+
this._renderBackgroundColor(ctx, color, width, height);
|
|
8766
8774
|
}
|
|
8767
8775
|
}
|
|
8768
8776
|
}
|
|
@@ -11881,7 +11889,17 @@ class Control {
|
|
|
11881
11889
|
}
|
|
11882
11890
|
getIsDisabledControl() {
|
|
11883
11891
|
var _a, _b;
|
|
11884
|
-
|
|
11892
|
+
if (!this.activeControl)
|
|
11893
|
+
return false;
|
|
11894
|
+
const { startIndex, endIndex } = this.range.getRange();
|
|
11895
|
+
if (startIndex === endIndex) {
|
|
11896
|
+
const elementList = this.getElementList();
|
|
11897
|
+
const startElement = elementList[startIndex];
|
|
11898
|
+
if (startElement.controlComponent === ControlComponent.POSTFIX) {
|
|
11899
|
+
return false;
|
|
11900
|
+
}
|
|
11901
|
+
}
|
|
11902
|
+
return !!((_b = (_a = this.activeControl.getElement()) == null ? void 0 : _a.control) == null ? void 0 : _b.disabled);
|
|
11885
11903
|
}
|
|
11886
11904
|
getContainer() {
|
|
11887
11905
|
return this.draw.getContainer();
|
|
@@ -14750,6 +14768,21 @@ class Draw {
|
|
|
14750
14768
|
return false;
|
|
14751
14769
|
}
|
|
14752
14770
|
}
|
|
14771
|
+
isDisabled() {
|
|
14772
|
+
var _a, _b, _c, _d;
|
|
14773
|
+
const { startIndex, endIndex } = this.range.getRange();
|
|
14774
|
+
const elementList = this.getElementList();
|
|
14775
|
+
if (startIndex === endIndex) {
|
|
14776
|
+
const startElement = elementList[startIndex];
|
|
14777
|
+
const nextElement = elementList[startIndex + 1];
|
|
14778
|
+
return !!(((_a = startElement == null ? void 0 : startElement.title) == null ? void 0 : _a.disabled) && ((_b = nextElement == null ? void 0 : nextElement.title) == null ? void 0 : _b.disabled) || ((_c = startElement == null ? void 0 : startElement.control) == null ? void 0 : _c.disabled) && ((_d = nextElement == null ? void 0 : nextElement.control) == null ? void 0 : _d.disabled));
|
|
14779
|
+
}
|
|
14780
|
+
const selectionElementList = elementList.slice(startIndex + 1, endIndex + 1);
|
|
14781
|
+
return selectionElementList.some((element) => {
|
|
14782
|
+
var _a2, _b2;
|
|
14783
|
+
return ((_a2 = element.title) == null ? void 0 : _a2.disabled) || ((_b2 = element.control) == null ? void 0 : _b2.disabled);
|
|
14784
|
+
});
|
|
14785
|
+
}
|
|
14753
14786
|
getOriginalWidth() {
|
|
14754
14787
|
const { paperDirection, width, height } = this.options;
|
|
14755
14788
|
return paperDirection === PaperDirection.VERTICAL ? width : height;
|
|
@@ -15319,10 +15352,11 @@ class Draw {
|
|
|
15319
15352
|
options: deepClone(this.options)
|
|
15320
15353
|
};
|
|
15321
15354
|
}
|
|
15322
|
-
setValue(payload) {
|
|
15355
|
+
setValue(payload, options) {
|
|
15323
15356
|
const { header, main, footer } = deepClone(payload);
|
|
15324
15357
|
if (!header && !main && !footer)
|
|
15325
15358
|
return;
|
|
15359
|
+
const { isSetCursor = false } = options || {};
|
|
15326
15360
|
const pageComponentData = [header, main, footer];
|
|
15327
15361
|
pageComponentData.forEach((data2) => {
|
|
15328
15362
|
if (!data2)
|
|
@@ -15337,8 +15371,13 @@ class Draw {
|
|
|
15337
15371
|
footer
|
|
15338
15372
|
});
|
|
15339
15373
|
this.historyManager.recovery();
|
|
15374
|
+
const curIndex = isSetCursor ? (main == null ? void 0 : main.length) ? main.length - 1 : 0 : void 0;
|
|
15375
|
+
if (curIndex !== void 0) {
|
|
15376
|
+
this.range.setRange(curIndex, curIndex);
|
|
15377
|
+
}
|
|
15340
15378
|
this.render({
|
|
15341
|
-
|
|
15379
|
+
curIndex,
|
|
15380
|
+
isSetCursor,
|
|
15342
15381
|
isFirstRender: true
|
|
15343
15382
|
});
|
|
15344
15383
|
}
|
|
@@ -16575,7 +16614,8 @@ const defaultBackground = {
|
|
|
16575
16614
|
color: "#FFFFFF",
|
|
16576
16615
|
image: "",
|
|
16577
16616
|
size: BackgroundSize.COVER,
|
|
16578
|
-
repeat: BackgroundRepeat.NO_REPEAT
|
|
16617
|
+
repeat: BackgroundRepeat.NO_REPEAT,
|
|
16618
|
+
applyPageNumbers: []
|
|
16579
16619
|
};
|
|
16580
16620
|
const defaultCheckboxOption = {
|
|
16581
16621
|
width: 14,
|
|
@@ -16922,13 +16962,13 @@ class CommandAdapt {
|
|
|
16922
16962
|
this.draw.setPainterStyle(painterStyle, options);
|
|
16923
16963
|
}
|
|
16924
16964
|
applyPainterStyle() {
|
|
16925
|
-
const isDisabled = this.draw.isReadonly() || this.
|
|
16965
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
16926
16966
|
if (isDisabled)
|
|
16927
16967
|
return;
|
|
16928
16968
|
this.canvasEvent.applyPainterStyle();
|
|
16929
16969
|
}
|
|
16930
16970
|
format() {
|
|
16931
|
-
const isDisabled = this.draw.isReadonly() || this.
|
|
16971
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
16932
16972
|
if (isDisabled)
|
|
16933
16973
|
return;
|
|
16934
16974
|
const selection = this.range.getSelectionElementList();
|
|
@@ -16956,7 +16996,7 @@ class CommandAdapt {
|
|
|
16956
16996
|
this.draw.render(renderOption);
|
|
16957
16997
|
}
|
|
16958
16998
|
font(payload) {
|
|
16959
|
-
const isDisabled = this.draw.isReadonly() || this.
|
|
16999
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
16960
17000
|
if (isDisabled)
|
|
16961
17001
|
return;
|
|
16962
17002
|
const selection = this.range.getSelectionElementList();
|
|
@@ -16979,7 +17019,7 @@ class CommandAdapt {
|
|
|
16979
17019
|
const { minSize, maxSize, defaultSize } = this.options;
|
|
16980
17020
|
if (payload < minSize || payload > maxSize)
|
|
16981
17021
|
return;
|
|
16982
|
-
const isDisabled = this.draw.isReadonly() || this.
|
|
17022
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
16983
17023
|
if (isDisabled)
|
|
16984
17024
|
return;
|
|
16985
17025
|
let renderOption = {};
|
|
@@ -17012,7 +17052,7 @@ class CommandAdapt {
|
|
|
17012
17052
|
}
|
|
17013
17053
|
}
|
|
17014
17054
|
sizeAdd() {
|
|
17015
|
-
const isDisabled = this.draw.isReadonly() || this.
|
|
17055
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
17016
17056
|
if (isDisabled)
|
|
17017
17057
|
return;
|
|
17018
17058
|
const selection = this.range.getTextLikeSelectionElementList();
|
|
@@ -17052,7 +17092,7 @@ class CommandAdapt {
|
|
|
17052
17092
|
}
|
|
17053
17093
|
}
|
|
17054
17094
|
sizeMinus() {
|
|
17055
|
-
const isDisabled = this.draw.isReadonly() || this.
|
|
17095
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
17056
17096
|
if (isDisabled)
|
|
17057
17097
|
return;
|
|
17058
17098
|
const selection = this.range.getTextLikeSelectionElementList();
|
|
@@ -17092,7 +17132,7 @@ class CommandAdapt {
|
|
|
17092
17132
|
}
|
|
17093
17133
|
}
|
|
17094
17134
|
bold() {
|
|
17095
|
-
const isDisabled = this.draw.isReadonly() || this.
|
|
17135
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
17096
17136
|
if (isDisabled)
|
|
17097
17137
|
return;
|
|
17098
17138
|
const selection = this.range.getSelectionElementList();
|
|
@@ -17113,7 +17153,7 @@ class CommandAdapt {
|
|
|
17113
17153
|
}
|
|
17114
17154
|
}
|
|
17115
17155
|
italic() {
|
|
17116
|
-
const isDisabled = this.draw.isReadonly() || this.
|
|
17156
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
17117
17157
|
if (isDisabled)
|
|
17118
17158
|
return;
|
|
17119
17159
|
const selection = this.range.getSelectionElementList();
|
|
@@ -17134,7 +17174,7 @@ class CommandAdapt {
|
|
|
17134
17174
|
}
|
|
17135
17175
|
}
|
|
17136
17176
|
underline(textDecoration) {
|
|
17137
|
-
const isDisabled = this.draw.isReadonly() || this.
|
|
17177
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
17138
17178
|
if (isDisabled)
|
|
17139
17179
|
return;
|
|
17140
17180
|
const selection = this.range.getSelectionElementList();
|
|
@@ -17163,7 +17203,7 @@ class CommandAdapt {
|
|
|
17163
17203
|
}
|
|
17164
17204
|
}
|
|
17165
17205
|
strikeout() {
|
|
17166
|
-
const isDisabled = this.draw.isReadonly() || this.
|
|
17206
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
17167
17207
|
if (isDisabled)
|
|
17168
17208
|
return;
|
|
17169
17209
|
const selection = this.range.getSelectionElementList();
|
|
@@ -17187,7 +17227,7 @@ class CommandAdapt {
|
|
|
17187
17227
|
}
|
|
17188
17228
|
}
|
|
17189
17229
|
superscript() {
|
|
17190
|
-
const isDisabled = this.draw.isReadonly() || this.
|
|
17230
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
17191
17231
|
if (isDisabled)
|
|
17192
17232
|
return;
|
|
17193
17233
|
const selection = this.range.getSelectionElementList();
|
|
@@ -17209,7 +17249,7 @@ class CommandAdapt {
|
|
|
17209
17249
|
this.draw.render({ isSetCursor: false });
|
|
17210
17250
|
}
|
|
17211
17251
|
subscript() {
|
|
17212
|
-
const isDisabled = this.draw.isReadonly() || this.
|
|
17252
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
17213
17253
|
if (isDisabled)
|
|
17214
17254
|
return;
|
|
17215
17255
|
const selection = this.range.getSelectionElementList();
|
|
@@ -17231,7 +17271,7 @@ class CommandAdapt {
|
|
|
17231
17271
|
this.draw.render({ isSetCursor: false });
|
|
17232
17272
|
}
|
|
17233
17273
|
color(payload) {
|
|
17234
|
-
const isDisabled = this.draw.isReadonly() || this.
|
|
17274
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
17235
17275
|
if (isDisabled)
|
|
17236
17276
|
return;
|
|
17237
17277
|
const selection = this.range.getSelectionElementList();
|
|
@@ -17262,7 +17302,7 @@ class CommandAdapt {
|
|
|
17262
17302
|
}
|
|
17263
17303
|
}
|
|
17264
17304
|
highlight(payload) {
|
|
17265
|
-
const isDisabled = this.draw.isReadonly() || this.
|
|
17305
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
17266
17306
|
if (isDisabled)
|
|
17267
17307
|
return;
|
|
17268
17308
|
const selection = this.range.getSelectionElementList();
|
|
@@ -18311,7 +18351,7 @@ class CommandAdapt {
|
|
|
18311
18351
|
}
|
|
18312
18352
|
}
|
|
18313
18353
|
image(payload) {
|
|
18314
|
-
const isDisabled = this.draw.isReadonly() || this.
|
|
18354
|
+
const isDisabled = this.draw.isReadonly() || this.draw.isDisabled();
|
|
18315
18355
|
if (isDisabled)
|
|
18316
18356
|
return;
|
|
18317
18357
|
const { startIndex, endIndex } = this.range.getRange();
|
|
@@ -18741,8 +18781,8 @@ class CommandAdapt {
|
|
|
18741
18781
|
}
|
|
18742
18782
|
}
|
|
18743
18783
|
}
|
|
18744
|
-
setValue(payload) {
|
|
18745
|
-
this.draw.setValue(payload);
|
|
18784
|
+
setValue(payload, options) {
|
|
18785
|
+
this.draw.setValue(payload, options);
|
|
18746
18786
|
}
|
|
18747
18787
|
removeControl() {
|
|
18748
18788
|
const { startIndex, endIndex } = this.range.getRange();
|