@hufe921/canvas-editor 0.9.53 → 0.9.54
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
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
## [0.9.54](https://github.com/Hufe921/canvas-editor/compare/v0.9.53...v0.9.54) (2023-11-03)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* clone payload data when call add element api #308 ([aeefca3](https://github.com/Hufe921/canvas-editor/commit/aeefca34caa86f9f52fb742e3f7555cd0364baa4)), closes [#308](https://github.com/Hufe921/canvas-editor/issues/308)
|
|
7
|
+
* print error of control assistant components in table #311 ([7fb0150](https://github.com/Hufe921/canvas-editor/commit/7fb0150635f80d62c2c27d2e2c976a3f0fa1deff)), closes [#311](https://github.com/Hufe921/canvas-editor/issues/311)
|
|
8
|
+
* set control value error in table #302 ([7fba458](https://github.com/Hufe921/canvas-editor/commit/7fba458d523ae06678557add90dc9d19a3cb02cb)), closes [#302](https://github.com/Hufe921/canvas-editor/issues/302)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Chores
|
|
12
|
+
|
|
13
|
+
* update hyperlink spell ([1bde309](https://github.com/Hufe921/canvas-editor/commit/1bde309cb5bcf797416a019f1a1507fd155dbed6))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Features
|
|
17
|
+
|
|
18
|
+
* add copy table cell content option to contextmenu #307 ([a94328f](https://github.com/Hufe921/canvas-editor/commit/a94328fa956c5164111c27773f557b9761cd775e)), closes [#307](https://github.com/Hufe921/canvas-editor/issues/307)
|
|
19
|
+
* support for insert more elements into control #306 ([d2d649b](https://github.com/Hufe921/canvas-editor/commit/d2d649b01123a13962b5ba45c2982f80cc701306)), closes [#306](https://github.com/Hufe921/canvas-editor/issues/306)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
1
23
|
## [0.9.53](https://github.com/Hufe921/canvas-editor/compare/v0.9.52...v0.9.53) (2023-10-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.54";
|
|
27
27
|
var MaxHeightRatio;
|
|
28
28
|
(function(MaxHeightRatio2) {
|
|
29
29
|
MaxHeightRatio2["HALF"] = "half";
|
|
@@ -4011,7 +4011,7 @@ function zipElementList(payload) {
|
|
|
4011
4011
|
}
|
|
4012
4012
|
dateElement.valueList = zipElementList(valueList);
|
|
4013
4013
|
element = dateElement;
|
|
4014
|
-
} else if (element.
|
|
4014
|
+
} else if (element.controlId) {
|
|
4015
4015
|
const controlId = element.controlId;
|
|
4016
4016
|
const control = element.control;
|
|
4017
4017
|
const controlElement = {
|
|
@@ -4027,8 +4027,8 @@ function zipElementList(payload) {
|
|
|
4027
4027
|
break;
|
|
4028
4028
|
}
|
|
4029
4029
|
if (controlE.controlComponent === ControlComponent.VALUE) {
|
|
4030
|
-
delete controlE.type;
|
|
4031
4030
|
delete controlE.control;
|
|
4031
|
+
delete controlE.controlId;
|
|
4032
4032
|
valueList.push(controlE);
|
|
4033
4033
|
}
|
|
4034
4034
|
e++;
|
|
@@ -4167,7 +4167,7 @@ function splitListElement(elementList) {
|
|
|
4167
4167
|
}
|
|
4168
4168
|
function createDomFromElementList(elementList, options) {
|
|
4169
4169
|
function buildDom(payload) {
|
|
4170
|
-
var _a, _b, _c, _d
|
|
4170
|
+
var _a, _b, _c, _d;
|
|
4171
4171
|
const clipboardDom = document.createElement("div");
|
|
4172
4172
|
for (let e = 0; e < payload.length; e++) {
|
|
4173
4173
|
const element = payload[e];
|
|
@@ -4243,17 +4243,17 @@ function createDomFromElementList(elementList, options) {
|
|
|
4243
4243
|
clipboardDom.append(tab);
|
|
4244
4244
|
} else if (!element.type || element.type === ElementType.LATEX || TEXTLIKE_ELEMENT_TYPE.includes(element.type)) {
|
|
4245
4245
|
let text = "";
|
|
4246
|
-
if (element.
|
|
4247
|
-
text = ((
|
|
4246
|
+
if (element.controlId) {
|
|
4247
|
+
text = ((_b = element.control.value) == null ? void 0 : _b.filter((v) => !v.type || TEXTLIKE_ELEMENT_TYPE.includes(v.type)).map((v) => v.value).join("")) || "";
|
|
4248
4248
|
} else if (element.type === ElementType.DATE) {
|
|
4249
|
-
text = ((
|
|
4249
|
+
text = ((_c = element.valueList) == null ? void 0 : _c.map((v) => v.value).join("")) || "";
|
|
4250
4250
|
} else {
|
|
4251
4251
|
text = element.value;
|
|
4252
4252
|
}
|
|
4253
4253
|
if (!text)
|
|
4254
4254
|
continue;
|
|
4255
4255
|
const dom = convertElementToDom(element, options);
|
|
4256
|
-
if (((
|
|
4256
|
+
if (((_d = payload[e - 1]) == null ? void 0 : _d.type) === ElementType.TITLE) {
|
|
4257
4257
|
text = text.replace(/^\n/, "");
|
|
4258
4258
|
}
|
|
4259
4259
|
if (dom.tagName === "P") {
|
|
@@ -5056,7 +5056,7 @@ function mousedown(evt, host) {
|
|
|
5056
5056
|
}
|
|
5057
5057
|
const previewer = draw.getPreviewer();
|
|
5058
5058
|
previewer.clearResizer();
|
|
5059
|
-
if (isDirectHitImage
|
|
5059
|
+
if (isDirectHitImage) {
|
|
5060
5060
|
previewer.drawResizer(curElement, positionList[curIndex], curElement.type === ElementType.LATEX ? {
|
|
5061
5061
|
mime: "svg",
|
|
5062
5062
|
srcKey: "laTexSVG"
|
|
@@ -5116,11 +5116,11 @@ function mouseup(evt, host) {
|
|
|
5116
5116
|
return;
|
|
5117
5117
|
}
|
|
5118
5118
|
const dragElementList = cacheElementList.slice(cacheRange.startIndex + 1, cacheRange.endIndex + 1);
|
|
5119
|
-
const isContainControl = dragElementList.find((element) => element.
|
|
5119
|
+
const isContainControl = dragElementList.find((element) => element.controlId);
|
|
5120
5120
|
if (isContainControl) {
|
|
5121
5121
|
const cacheStartElement2 = cacheElementList[cacheRange.startIndex + 1];
|
|
5122
5122
|
const cacheEndElement2 = cacheElementList[cacheRange.endIndex];
|
|
5123
|
-
const isAllowDragControl = (cacheStartElement2.
|
|
5123
|
+
const isAllowDragControl = (!cacheStartElement2.controlId || cacheStartElement2.controlComponent === ControlComponent.PREFIX) && (!cacheEndElement2.controlId || cacheEndElement2.controlComponent === ControlComponent.POSTFIX) || cacheStartElement2.controlId === cacheEndElement2.controlId && cacheStartElement2.controlComponent === ControlComponent.PREFIX && cacheEndElement2.controlComponent === ControlComponent.POSTFIX || ((_a = cacheStartElement2.control) == null ? void 0 : _a.type) === ControlType.TEXT && cacheStartElement2.controlComponent === ControlComponent.VALUE && ((_b = cacheEndElement2.control) == null ? void 0 : _b.type) === ControlType.TEXT && cacheEndElement2.controlComponent === ControlComponent.VALUE;
|
|
5124
5124
|
if (!isAllowDragControl) {
|
|
5125
5125
|
draw.render({
|
|
5126
5126
|
curIndex: range.startIndex,
|
|
@@ -5179,7 +5179,7 @@ function mouseup(evt, host) {
|
|
|
5179
5179
|
const cacheRangeStartIndex = getElementIndexByDragId(cacheRangeStartId, cacheElementList);
|
|
5180
5180
|
const cacheRangeEndIndex = getElementIndexByDragId(cacheRangeEndId, cacheElementList);
|
|
5181
5181
|
const cacheEndElement = cacheElementList[cacheRangeEndIndex];
|
|
5182
|
-
if (cacheEndElement.
|
|
5182
|
+
if (cacheEndElement.controlId && cacheEndElement.controlComponent !== ControlComponent.POSTFIX) {
|
|
5183
5183
|
rangeManager.replaceRange(__spreadProps(__spreadValues({}, cacheRange), {
|
|
5184
5184
|
startIndex: cacheRangeStartIndex,
|
|
5185
5185
|
endIndex: cacheRangeEndIndex
|
|
@@ -5300,10 +5300,9 @@ function keydown(evt, host) {
|
|
|
5300
5300
|
const { startIndex, endIndex } = rangeManager.getRange();
|
|
5301
5301
|
const isCollapsed = startIndex === endIndex;
|
|
5302
5302
|
const control = draw.getControl();
|
|
5303
|
-
const isPartRangeInControlOutside = control.isPartRangeInControlOutside();
|
|
5304
5303
|
const activeControl = control.getActiveControl();
|
|
5305
5304
|
if (evt.key === KeyMap.Backspace) {
|
|
5306
|
-
if (isReadonly || isPartRangeInControlOutside)
|
|
5305
|
+
if (isReadonly || control.isPartRangeInControlOutside())
|
|
5307
5306
|
return;
|
|
5308
5307
|
let curIndex;
|
|
5309
5308
|
if (activeControl) {
|
|
@@ -5334,12 +5333,12 @@ function keydown(evt, host) {
|
|
|
5334
5333
|
rangeManager.setRange(curIndex, curIndex);
|
|
5335
5334
|
draw.render({ curIndex });
|
|
5336
5335
|
} else if (evt.key === KeyMap.Delete) {
|
|
5337
|
-
if (isReadonly || isPartRangeInControlOutside)
|
|
5336
|
+
if (isReadonly || control.isPartRangeInControlOutside())
|
|
5338
5337
|
return;
|
|
5339
5338
|
let curIndex;
|
|
5340
5339
|
if (activeControl) {
|
|
5341
5340
|
curIndex = control.keydown(evt);
|
|
5342
|
-
} else if ((
|
|
5341
|
+
} else if ((_a = elementList[endIndex + 1]) == null ? void 0 : _a.controlId) {
|
|
5343
5342
|
curIndex = control.removeControl(endIndex + 1);
|
|
5344
5343
|
} else {
|
|
5345
5344
|
if (!isCollapsed) {
|
|
@@ -5354,7 +5353,7 @@ function keydown(evt, host) {
|
|
|
5354
5353
|
rangeManager.setRange(curIndex, curIndex);
|
|
5355
5354
|
draw.render({ curIndex });
|
|
5356
5355
|
} else if (evt.key === KeyMap.Enter) {
|
|
5357
|
-
if (isReadonly || isPartRangeInControlOutside)
|
|
5356
|
+
if (isReadonly || control.isPartRangeInControlOutside())
|
|
5358
5357
|
return;
|
|
5359
5358
|
const enterText = {
|
|
5360
5359
|
value: ZERO
|
|
@@ -6546,7 +6545,7 @@ class Position {
|
|
|
6546
6545
|
return {
|
|
6547
6546
|
index: index2,
|
|
6548
6547
|
isCheckbox: tdValueElement.type === ElementType.CHECKBOX || tdValueElement.controlComponent === ControlComponent.CHECKBOX,
|
|
6549
|
-
isControl: tdValueElement.
|
|
6548
|
+
isControl: !!tdValueElement.controlId,
|
|
6550
6549
|
isImage: tablePosition.isImage,
|
|
6551
6550
|
isDirectHit: tablePosition.isDirectHit,
|
|
6552
6551
|
isTable: true,
|
|
@@ -6589,7 +6588,7 @@ class Position {
|
|
|
6589
6588
|
return {
|
|
6590
6589
|
hitLineStartIndex: hitLineStartIndex2,
|
|
6591
6590
|
index: curPositionIndex2,
|
|
6592
|
-
isControl: element.
|
|
6591
|
+
isControl: !!element.controlId
|
|
6593
6592
|
};
|
|
6594
6593
|
}
|
|
6595
6594
|
}
|
|
@@ -6672,7 +6671,7 @@ class Position {
|
|
|
6672
6671
|
return {
|
|
6673
6672
|
hitLineStartIndex,
|
|
6674
6673
|
index: curPositionIndex,
|
|
6675
|
-
isControl: ((_b = elementList[curPositionIndex]) == null ? void 0 : _b.
|
|
6674
|
+
isControl: !!((_b = elementList[curPositionIndex]) == null ? void 0 : _b.controlId)
|
|
6676
6675
|
};
|
|
6677
6676
|
}
|
|
6678
6677
|
adjustPositionContext(payload) {
|
|
@@ -6927,7 +6926,7 @@ class RangeManager {
|
|
|
6927
6926
|
if (~startIndex && ~endIndex) {
|
|
6928
6927
|
const elementList = this.draw.getElementList();
|
|
6929
6928
|
const element = elementList[startIndex];
|
|
6930
|
-
if (
|
|
6929
|
+
if (element == null ? void 0 : element.controlId) {
|
|
6931
6930
|
control.initControl();
|
|
6932
6931
|
return;
|
|
6933
6932
|
}
|
|
@@ -8798,7 +8797,7 @@ class SelectControl {
|
|
|
8798
8797
|
return -1;
|
|
8799
8798
|
const draw = this.control.getDraw();
|
|
8800
8799
|
draw.spliceElementList(elementList, leftIndex + 1, rightIndex - leftIndex);
|
|
8801
|
-
this.control.addPlaceholder(preIndex);
|
|
8800
|
+
this.control.addPlaceholder(preIndex, context);
|
|
8802
8801
|
this.element.control.code = null;
|
|
8803
8802
|
return preIndex;
|
|
8804
8803
|
}
|
|
@@ -8813,7 +8812,7 @@ class SelectControl {
|
|
|
8813
8812
|
const elementList = context.elementList || this.control.getElementList();
|
|
8814
8813
|
const styleElement = pickObject(this.getValue(context)[0], EDITOR_ELEMENT_STYLE_ATTR);
|
|
8815
8814
|
const prefixIndex = this.clearSelect(context);
|
|
8816
|
-
this.control.removePlaceholder(prefixIndex);
|
|
8815
|
+
this.control.removePlaceholder(prefixIndex, context);
|
|
8817
8816
|
const propertyElement = omitObject(elementList[prefixIndex], EDITOR_ELEMENT_STYLE_ATTR);
|
|
8818
8817
|
const start = prefixIndex + 1;
|
|
8819
8818
|
const data2 = splitText(valueSet.value);
|
|
@@ -8935,10 +8934,10 @@ class TextControl {
|
|
|
8935
8934
|
if (startIndex !== endIndex) {
|
|
8936
8935
|
draw.spliceElementList(elementList, startIndex + 1, endIndex - startIndex);
|
|
8937
8936
|
} else {
|
|
8938
|
-
this.control.removePlaceholder(startIndex);
|
|
8937
|
+
this.control.removePlaceholder(startIndex, context);
|
|
8939
8938
|
}
|
|
8940
8939
|
const startElement = elementList[startIndex];
|
|
8941
|
-
const anchorElement = startElement.controlComponent === ControlComponent.PREFIX ?
|
|
8940
|
+
const anchorElement = startElement.type && !TEXTLIKE_ELEMENT_TYPE.includes(startElement.type) || startElement.controlComponent === ControlComponent.PREFIX ? pickObject(startElement, ["control", "controlId"]) : omitObject(startElement, ["type"]);
|
|
8942
8941
|
const start = range.startIndex + 1;
|
|
8943
8942
|
for (let i = 0; i < data2.length; i++) {
|
|
8944
8943
|
const newElement = __spreadProps(__spreadValues(__spreadValues({}, anchorElement), data2[i]), {
|
|
@@ -9046,18 +9045,24 @@ class Control {
|
|
|
9046
9045
|
getDraw() {
|
|
9047
9046
|
return this.draw;
|
|
9048
9047
|
}
|
|
9049
|
-
filterAssistElement(
|
|
9050
|
-
|
|
9051
|
-
|
|
9052
|
-
|
|
9053
|
-
|
|
9054
|
-
|
|
9055
|
-
|
|
9048
|
+
filterAssistElement(elementList) {
|
|
9049
|
+
return elementList.filter((element) => {
|
|
9050
|
+
var _a;
|
|
9051
|
+
if (element.type === ElementType.TABLE) {
|
|
9052
|
+
const trList = element.trList;
|
|
9053
|
+
for (let r = 0; r < trList.length; r++) {
|
|
9054
|
+
const tr = trList[r];
|
|
9055
|
+
for (let d = 0; d < tr.tdList.length; d++) {
|
|
9056
|
+
const td = tr.tdList[d];
|
|
9057
|
+
td.value = this.filterAssistElement(td.value);
|
|
9058
|
+
}
|
|
9056
9059
|
}
|
|
9057
|
-
|
|
9058
|
-
|
|
9060
|
+
}
|
|
9061
|
+
if (!element.controlId || ((_a = element.control) == null ? void 0 : _a.minWidth)) {
|
|
9062
|
+
return true;
|
|
9063
|
+
}
|
|
9064
|
+
return element.controlComponent !== ControlComponent.PREFIX && element.controlComponent !== ControlComponent.POSTFIX && element.controlComponent !== ControlComponent.PLACEHOLDER;
|
|
9059
9065
|
});
|
|
9060
|
-
return payload;
|
|
9061
9066
|
}
|
|
9062
9067
|
isPartRangeInControlOutside() {
|
|
9063
9068
|
const { startIndex, endIndex } = this.getRange();
|
|
@@ -9066,7 +9071,7 @@ class Control {
|
|
|
9066
9071
|
const elementList = this.getElementList();
|
|
9067
9072
|
const startElement = elementList[startIndex];
|
|
9068
9073
|
const endElement = elementList[endIndex];
|
|
9069
|
-
if (
|
|
9074
|
+
if (startElement.controlId && startElement.controlId !== endElement.controlId) {
|
|
9070
9075
|
return true;
|
|
9071
9076
|
}
|
|
9072
9077
|
return false;
|
|
@@ -9088,7 +9093,7 @@ class Control {
|
|
|
9088
9093
|
const elementList = this.getElementList();
|
|
9089
9094
|
const startElement = elementList[startIndex];
|
|
9090
9095
|
const endElement = elementList[endIndex];
|
|
9091
|
-
if (
|
|
9096
|
+
if (startElement.controlId && startElement.controlId === endElement.controlId && endElement.controlComponent !== ControlComponent.POSTFIX) {
|
|
9092
9097
|
return true;
|
|
9093
9098
|
}
|
|
9094
9099
|
return false;
|
|
@@ -9249,8 +9254,8 @@ class Control {
|
|
|
9249
9254
|
newElement: element
|
|
9250
9255
|
};
|
|
9251
9256
|
}
|
|
9252
|
-
removeControl(startIndex) {
|
|
9253
|
-
const elementList = this.getElementList();
|
|
9257
|
+
removeControl(startIndex, context = {}) {
|
|
9258
|
+
const elementList = context.elementList || this.getElementList();
|
|
9254
9259
|
const startElement = elementList[startIndex];
|
|
9255
9260
|
const { deletable = true } = startElement.control;
|
|
9256
9261
|
if (!deletable)
|
|
@@ -9284,8 +9289,8 @@ class Control {
|
|
|
9284
9289
|
this.draw.spliceElementList(elementList, leftIndex + 1, rightIndex - leftIndex);
|
|
9285
9290
|
return leftIndex;
|
|
9286
9291
|
}
|
|
9287
|
-
removePlaceholder(startIndex) {
|
|
9288
|
-
const elementList = this.getElementList();
|
|
9292
|
+
removePlaceholder(startIndex, context = {}) {
|
|
9293
|
+
const elementList = context.elementList || this.getElementList();
|
|
9289
9294
|
const startElement = elementList[startIndex];
|
|
9290
9295
|
const nextElement = elementList[startIndex + 1];
|
|
9291
9296
|
if (startElement.controlComponent === ControlComponent.PLACEHOLDER || nextElement.controlComponent === ControlComponent.PLACEHOLDER) {
|
|
@@ -9302,8 +9307,8 @@ class Control {
|
|
|
9302
9307
|
}
|
|
9303
9308
|
}
|
|
9304
9309
|
}
|
|
9305
|
-
addPlaceholder(startIndex) {
|
|
9306
|
-
const elementList = this.getElementList();
|
|
9310
|
+
addPlaceholder(startIndex, context = {}) {
|
|
9311
|
+
const elementList = context.elementList || this.getElementList();
|
|
9307
9312
|
const startElement = elementList[startIndex];
|
|
9308
9313
|
const control = startElement.control;
|
|
9309
9314
|
if (!control.placeholder)
|
|
@@ -9388,22 +9393,27 @@ class Control {
|
|
|
9388
9393
|
return result;
|
|
9389
9394
|
}
|
|
9390
9395
|
setValueByConceptId(payload) {
|
|
9391
|
-
var _a;
|
|
9392
9396
|
const isReadonly = this.draw.isReadonly();
|
|
9393
9397
|
if (isReadonly)
|
|
9394
9398
|
return;
|
|
9395
9399
|
let isExistSet = false;
|
|
9396
9400
|
const { conceptId, value } = payload;
|
|
9397
|
-
const
|
|
9398
|
-
|
|
9399
|
-
this.draw.getOriginalMainElementList(),
|
|
9400
|
-
this.draw.getFooterElementList()
|
|
9401
|
-
];
|
|
9402
|
-
for (const elementList of data2) {
|
|
9401
|
+
const setValue = (elementList) => {
|
|
9402
|
+
var _a;
|
|
9403
9403
|
let i = 0;
|
|
9404
9404
|
while (i < elementList.length) {
|
|
9405
9405
|
const element = elementList[i];
|
|
9406
9406
|
i++;
|
|
9407
|
+
if (element.type === ElementType.TABLE) {
|
|
9408
|
+
const trList = element.trList;
|
|
9409
|
+
for (let r = 0; r < trList.length; r++) {
|
|
9410
|
+
const tr = trList[r];
|
|
9411
|
+
for (let d = 0; d < tr.tdList.length; d++) {
|
|
9412
|
+
const td = tr.tdList[d];
|
|
9413
|
+
setValue(td.value);
|
|
9414
|
+
}
|
|
9415
|
+
}
|
|
9416
|
+
}
|
|
9407
9417
|
if (((_a = element == null ? void 0 : element.control) == null ? void 0 : _a.conceptId) !== conceptId)
|
|
9408
9418
|
continue;
|
|
9409
9419
|
isExistSet = true;
|
|
@@ -9463,6 +9473,14 @@ class Control {
|
|
|
9463
9473
|
}
|
|
9464
9474
|
i = newEndIndex;
|
|
9465
9475
|
}
|
|
9476
|
+
};
|
|
9477
|
+
const data2 = [
|
|
9478
|
+
this.draw.getHeaderElementList(),
|
|
9479
|
+
this.draw.getOriginalMainElementList(),
|
|
9480
|
+
this.draw.getFooterElementList()
|
|
9481
|
+
];
|
|
9482
|
+
for (const elementList of data2) {
|
|
9483
|
+
setValue(elementList);
|
|
9466
9484
|
}
|
|
9467
9485
|
if (isExistSet) {
|
|
9468
9486
|
this.draw.render({
|
|
@@ -9541,7 +9559,7 @@ class CheckboxParticle {
|
|
|
9541
9559
|
ctx.restore();
|
|
9542
9560
|
}
|
|
9543
9561
|
}
|
|
9544
|
-
const encodedJs$2 = "
|
|
9562
|
+
const encodedJs$2 = "KCgpPT57KGZ1bmN0aW9uKCl7InVzZSBzdHJpY3QiO3ZhciBmOyhmdW5jdGlvbih0KXt0LlRFWFQ9InRleHQiLHQuVEFCTEU9InRhYmxlIix0LkhZUEVSTElOSz0iaHlwZXJsaW5rIix0LkNPTlRST0w9ImNvbnRyb2wifSkoZnx8KGY9e30pKTt2YXIgcDsoZnVuY3Rpb24odCl7dC5WQUxVRT0idmFsdWUifSkocHx8KHA9e30pKTtjb25zdCBoPSJcdTIwMEIiLGc9YApgO2Z1bmN0aW9uIGEodCl7bGV0IGw9IiIsbj0wO2Zvcig7bjx0Lmxlbmd0aDspe2NvbnN0IG89dFtuXTtpZihvLnR5cGU9PT1mLlRBQkxFKXtpZihvLnRyTGlzdClmb3IobGV0IHI9MDtyPG8udHJMaXN0Lmxlbmd0aDtyKyspe2NvbnN0IHM9by50ckxpc3Rbcl07Zm9yKGxldCBlPTA7ZTxzLnRkTGlzdC5sZW5ndGg7ZSsrKXtjb25zdCBpPXMudGRMaXN0W2VdO2wrPWEoaS52YWx1ZSl9fX1lbHNlIGlmKG8udHlwZT09PWYuSFlQRVJMSU5LKXtjb25zdCByPW8uaHlwZXJsaW5rSWQscz1bXTtmb3IoO248dC5sZW5ndGg7KXtjb25zdCBlPXRbbl07aWYociE9PWUuaHlwZXJsaW5rSWQpe24tLTticmVha31kZWxldGUgZS50eXBlLHMucHVzaChlKSxuKyt9bCs9YShzKX1lbHNlIGlmKG8uY29udHJvbElkKXtjb25zdCByPW8uY29udHJvbElkLHM9W107Zm9yKDtuPHQubGVuZ3RoOyl7Y29uc3QgZT10W25dO2lmKHIhPT1lLmNvbnRyb2xJZCl7bi0tO2JyZWFrfWUuY29udHJvbENvbXBvbmVudD09PXAuVkFMVUUmJihkZWxldGUgZS5jb250cm9sSWQscy5wdXNoKGUpKSxuKyt9bCs9YShzKX0oIW8udHlwZXx8by50eXBlPT09Zi5URVhUKSYmKGwrPW8udmFsdWUpLG4rK31yZXR1cm4gbH1mdW5jdGlvbiBkKHQpe2NvbnN0IGw9W10sbj0vWzAtOV0vLG89L1tBLVphLXpdLyxyPS9ccy87bGV0IHM9ITEsZT0hMSxpPSIiO2Z1bmN0aW9uIHUoKXtpJiYobC5wdXNoKGkpLGk9IiIpfWZvcihjb25zdCBjIG9mIHQpby50ZXN0KGMpPyhzfHx1KCksaSs9YyxzPSEwLGU9ITEpOm4udGVzdChjKT8oZXx8dSgpLGkrPWMscz0hMSxlPSEwKToodSgpLHM9ITEsZT0hMSxyLnRlc3QoYyl8fGwucHVzaChjKSk7cmV0dXJuIHUoKSxsfW9ubWVzc2FnZT10PT57Y29uc3QgbD10LmRhdGEsbz1hKGwpLnJlcGxhY2UobmV3IFJlZ0V4cChgXiR7aH1gKSwiIikucmVwbGFjZShuZXcgUmVnRXhwKGgsImciKSxnKSxyPWQobyk7cG9zdE1lc3NhZ2Uoci5sZW5ndGgpfX0pKCk7fSkoKTsK";
|
|
9545
9563
|
const blob$2 = typeof window !== "undefined" && window.Blob && new Blob([atob(encodedJs$2)], { type: "text/javascript;charset=utf-8" });
|
|
9546
9564
|
function WorkerWrapper$2() {
|
|
9547
9565
|
const objURL = blob$2 && (window.URL || window.webkitURL).createObjectURL(blob$2);
|
|
@@ -11540,7 +11558,12 @@ class Draw {
|
|
|
11540
11558
|
main: this.elementList,
|
|
11541
11559
|
footer: this.footer.getElementList()
|
|
11542
11560
|
};
|
|
11543
|
-
|
|
11561
|
+
const clonePrintModeData = deepClone(this.printModeData);
|
|
11562
|
+
const editorDataKeys = ["header", "main", "footer"];
|
|
11563
|
+
editorDataKeys.forEach((key) => {
|
|
11564
|
+
clonePrintModeData[key] = this.control.filterAssistElement(clonePrintModeData[key]);
|
|
11565
|
+
});
|
|
11566
|
+
this.setEditorData(clonePrintModeData);
|
|
11544
11567
|
}
|
|
11545
11568
|
if (this.mode === EditorMode.PRINT && this.printModeData) {
|
|
11546
11569
|
this.setEditorData(this.printModeData);
|
|
@@ -11727,9 +11750,10 @@ class Draw {
|
|
|
11727
11750
|
return this.header.getElementList();
|
|
11728
11751
|
}
|
|
11729
11752
|
getTableElementList(sourceElementList) {
|
|
11753
|
+
var _a;
|
|
11730
11754
|
const positionContext = this.position.getPositionContext();
|
|
11731
11755
|
const { index: index2, trIndex, tdIndex } = positionContext;
|
|
11732
|
-
return sourceElementList[index2].trList[trIndex].tdList[tdIndex].value;
|
|
11756
|
+
return ((_a = sourceElementList[index2].trList) == null ? void 0 : _a[trIndex].tdList[tdIndex].value) || [];
|
|
11733
11757
|
}
|
|
11734
11758
|
getElementList() {
|
|
11735
11759
|
const positionContext = this.position.getPositionContext();
|
|
@@ -13409,9 +13433,6 @@ class CommandAdapt {
|
|
|
13409
13433
|
const isReadonly = this.draw.isReadonly();
|
|
13410
13434
|
if (isReadonly)
|
|
13411
13435
|
return;
|
|
13412
|
-
const activeControl = this.control.getActiveControl();
|
|
13413
|
-
if (activeControl)
|
|
13414
|
-
return;
|
|
13415
13436
|
const selection = this.range.getSelectionElementList();
|
|
13416
13437
|
if (!selection)
|
|
13417
13438
|
return;
|
|
@@ -13434,9 +13455,6 @@ class CommandAdapt {
|
|
|
13434
13455
|
const isReadonly = this.draw.isReadonly();
|
|
13435
13456
|
if (isReadonly)
|
|
13436
13457
|
return;
|
|
13437
|
-
const activeControl = this.control.getActiveControl();
|
|
13438
|
-
if (activeControl)
|
|
13439
|
-
return;
|
|
13440
13458
|
const selection = this.range.getSelectionElementList();
|
|
13441
13459
|
if (!selection)
|
|
13442
13460
|
return;
|
|
@@ -14823,10 +14841,11 @@ class CommandAdapt {
|
|
|
14823
14841
|
const isReadonly = this.draw.isReadonly();
|
|
14824
14842
|
if (isReadonly)
|
|
14825
14843
|
return;
|
|
14844
|
+
const cloneElementList = deepClone(payload);
|
|
14826
14845
|
const { startIndex } = this.range.getRange();
|
|
14827
14846
|
const elementList = this.draw.getElementList();
|
|
14828
|
-
formatElementContext(elementList,
|
|
14829
|
-
this.draw.insertElementList(
|
|
14847
|
+
formatElementContext(elementList, cloneElementList, startIndex);
|
|
14848
|
+
this.draw.insertElementList(cloneElementList);
|
|
14830
14849
|
}
|
|
14831
14850
|
appendElementList(elementList, options) {
|
|
14832
14851
|
if (!elementList.length)
|
|
@@ -14834,7 +14853,7 @@ class CommandAdapt {
|
|
|
14834
14853
|
const isReadonly = this.draw.isReadonly();
|
|
14835
14854
|
if (isReadonly)
|
|
14836
14855
|
return;
|
|
14837
|
-
this.draw.appendElementList(elementList, options);
|
|
14856
|
+
this.draw.appendElementList(deepClone(elementList), options);
|
|
14838
14857
|
}
|
|
14839
14858
|
setValue(payload) {
|
|
14840
14859
|
this.draw.setValue(payload);
|
|
@@ -14845,7 +14864,7 @@ class CommandAdapt {
|
|
|
14845
14864
|
return;
|
|
14846
14865
|
const elementList = this.draw.getElementList();
|
|
14847
14866
|
const element = elementList[startIndex];
|
|
14848
|
-
if (element.
|
|
14867
|
+
if (!element.controlId)
|
|
14849
14868
|
return;
|
|
14850
14869
|
const control = this.draw.getControl();
|
|
14851
14870
|
const newIndex = control.removeControl(startIndex);
|
|
@@ -15033,7 +15052,7 @@ const INTERNAL_CONTEXT_MENU_KEY = {
|
|
|
15033
15052
|
HYPERLINK: {
|
|
15034
15053
|
DELETE: "hyperlinkDelete",
|
|
15035
15054
|
CANCEL: "hyperlinkCancel",
|
|
15036
|
-
EDIT: "
|
|
15055
|
+
EDIT: "hyperlinkEdit"
|
|
15037
15056
|
},
|
|
15038
15057
|
IMAGE: {
|
|
15039
15058
|
CHANGE: "imageChange",
|
|
@@ -15075,7 +15094,7 @@ const controlMenus = [
|
|
|
15075
15094
|
i18nPath: "contextmenu.control.delete",
|
|
15076
15095
|
when: (payload) => {
|
|
15077
15096
|
var _a;
|
|
15078
|
-
return !payload.isReadonly && !payload.editorHasSelection && ((_a = payload.startElement) == null ? void 0 : _a.
|
|
15097
|
+
return !payload.isReadonly && !payload.editorHasSelection && !!((_a = payload.startElement) == null ? void 0 : _a.controlId);
|
|
15079
15098
|
},
|
|
15080
15099
|
callback: (command) => {
|
|
15081
15100
|
command.executeRemoveControl();
|
|
@@ -15100,7 +15119,7 @@ const globalMenus = [
|
|
|
15100
15119
|
i18nPath: "contextmenu.global.copy",
|
|
15101
15120
|
shortCut: `${isApple ? "\u2318" : "Ctrl"} + C`,
|
|
15102
15121
|
when: (payload) => {
|
|
15103
|
-
return payload.editorHasSelection;
|
|
15122
|
+
return payload.editorHasSelection || payload.isCrossRowCol;
|
|
15104
15123
|
},
|
|
15105
15124
|
callback: (command) => {
|
|
15106
15125
|
command.executeCopy();
|