hoeditor-web 3.2.78 → 3.2.79
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/lib/hoeditor.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "vue";
|
|
2
|
-
import { H as i, d as r, b as e, a as l, e as t, T as H, f as d, i as f } from "./index-
|
|
2
|
+
import { H as i, d as r, b as e, a as l, e as t, T as H, f as d, i as f } from "./index-RSacoGIm.mjs";
|
|
3
3
|
export {
|
|
4
4
|
i as HoDocs,
|
|
5
5
|
r as HoEditorProvide,
|
|
@@ -14966,7 +14966,7 @@ class DrawSignNode extends DrawCombineNode {
|
|
|
14966
14966
|
}
|
|
14967
14967
|
}
|
|
14968
14968
|
}
|
|
14969
|
-
const version = "3.2.
|
|
14969
|
+
const version = "3.2.79";
|
|
14970
14970
|
var FingerPosition = /* @__PURE__ */ ((a) => (a[a.left = 0] = "left", a[a.center = 1] = "center", a[a.right = 2] = "right", a))(FingerPosition || {});
|
|
14971
14971
|
class SignNode extends BaseNode {
|
|
14972
14972
|
constructor(hoEditorFactoryID, rootNodes, pNode, nodeType, number, type, name, signType, signFormat, signor, signTime, signTimeFormat, imgSrc, imgWidth, imgHeight, customProperty, isTemplate, styleIndex, connectMode, isFront, allowEditSignTime, fingerPrintSrc, fingerPosition, attribute, connectChar, otherProperties, dataId, associatedElement, isTemp, innerIdentifier) {
|
|
@@ -37869,7 +37869,7 @@ class DrawImageNode extends DrawCombineNode {
|
|
|
37869
37869
|
}
|
|
37870
37870
|
this.updateSign(), n.loadImageCount--;
|
|
37871
37871
|
}, this.markImagePath != "" && this.insertMarkImage(), o.onerror = () => {
|
|
37872
|
-
if (n.loadImageCount--, !r.node.isBackFill) {
|
|
37872
|
+
if (n.loadImageCount--, n.loadImageErrorCount++, !r.node.isBackFill) {
|
|
37873
37873
|
const l = this.node.previousLeaf().getNodePath();
|
|
37874
37874
|
n.docTree.deleteNode(this.node);
|
|
37875
37875
|
const c = new NodeChangeEvent(this._hoEditorFactoryID, DocAction.daModifyStyle, l, l);
|
|
@@ -48191,7 +48191,7 @@ class VueController {
|
|
|
48191
48191
|
}
|
|
48192
48192
|
/**
|
|
48193
48193
|
* 浏览 编辑 审阅 状态切换
|
|
48194
|
-
* @status number 0:设计模式 1: 编辑模式 2:打印预览 4: 审阅模式 5: 浏览(只读)模式 6 留痕预览
|
|
48194
|
+
* @status number 0:设计模式 1: 编辑模式 2:打印预览 4: 审阅模式 5: 浏览(只读)模式 6 留痕 7留痕预览
|
|
48195
48195
|
* @printStatus 0:打印鼠标点击位置 1:打印鼠标选中 2:打印全部 3:续打
|
|
48196
48196
|
*/
|
|
48197
48197
|
setEditorStatus(t, r) {
|
|
@@ -52651,7 +52651,7 @@ class VueController {
|
|
|
52651
52651
|
text: d.text,
|
|
52652
52652
|
nodeType: "ntText",
|
|
52653
52653
|
path: this.getPathByNode(d)
|
|
52654
|
-
}) : d
|
|
52654
|
+
}) : d.childNodes && d.childNodes.length && s(d.childNodes);
|
|
52655
52655
|
}
|
|
52656
52656
|
};
|
|
52657
52657
|
return s(r.docTree.mainNodes), t;
|
|
@@ -64619,7 +64619,7 @@ WebPDecoder.prototype.getData = function() {
|
|
|
64619
64619
|
(function(a) {
|
|
64620
64620
|
function t() {
|
|
64621
64621
|
return function() {
|
|
64622
|
-
return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-
|
|
64622
|
+
return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-CyxgRuIp.mjs");
|
|
64623
64623
|
}().catch(function(r) {
|
|
64624
64624
|
return Promise.reject(new Error("Could not load canvg: " + r));
|
|
64625
64625
|
}).then(function(r) {
|
|
@@ -65897,7 +65897,9 @@ class PrintController {
|
|
|
65897
65897
|
async createBase64(t, r) {
|
|
65898
65898
|
if (!this._isSetFont)
|
|
65899
65899
|
return;
|
|
65900
|
-
const o = HOEditorFactorys.instance().getFactory(this._hoEditorFactoryID)
|
|
65900
|
+
const o = HOEditorFactorys.instance().getFactory(this._hoEditorFactoryID);
|
|
65901
|
+
o.loadImageErrorCount = 0;
|
|
65902
|
+
const n = o.docTree.curDomRange.normalize().endPath, s = o.drawTree.paintStatus, l = o.vueController.getDocXml(!1), c = o.pageProperty.widthMm > o.pageProperty.heightMm ? "l" : "p", d = [o.pageProperty.widthPixes, o.pageProperty.heightPixes], u = {
|
|
65901
65903
|
orientation: c,
|
|
65902
65904
|
unit: "px",
|
|
65903
65905
|
format: d,
|
|
@@ -65906,31 +65908,42 @@ class PrintController {
|
|
|
65906
65908
|
};
|
|
65907
65909
|
this.clearJsPDF(), this.PDF = new jsPDF(u);
|
|
65908
65910
|
let f = Promise.resolve();
|
|
65909
|
-
|
|
65910
|
-
o.
|
|
65911
|
-
}
|
|
65912
|
-
|
|
65911
|
+
const p = (g) => {
|
|
65912
|
+
o.vueController.waitLoadImageCount(() => g());
|
|
65913
|
+
};
|
|
65914
|
+
f = f.then(() => new Promise((g) => {
|
|
65915
|
+
o.printStatus.printMode = 0, o.drawTree.paintStatus = PaintState.psPreview, o.drawTree.rebuildAllDrawLine(!1, p(g), !1);
|
|
65916
|
+
})), f = f.then(() => new Promise((g) => {
|
|
65917
|
+
o.loadImageErrorCount > 0 ? g() : Print.createPDFBase64(this._hoEditorFactoryID, g, this.PDF);
|
|
65913
65918
|
}));
|
|
65914
|
-
const
|
|
65919
|
+
const m = await f.then((g) => (o.drawTree.paintStatus = s, new Promise((y) => {
|
|
65915
65920
|
o.vueController.openXml(l).then(() => {
|
|
65916
|
-
var
|
|
65917
|
-
|
|
65918
|
-
|
|
65919
|
-
|
|
65920
|
-
(
|
|
65921
|
-
|
|
65922
|
-
|
|
65923
|
-
|
|
65924
|
-
t({
|
|
65925
|
-
|
|
65926
|
-
|
|
65927
|
-
|
|
65928
|
-
|
|
65921
|
+
var w, v;
|
|
65922
|
+
if (o.loadImageErrorCount === 0) {
|
|
65923
|
+
const C = this.PDF.internal.getNumberOfPages() - g;
|
|
65924
|
+
if (C >= 2)
|
|
65925
|
+
for (let D = 0; D < C; D++)
|
|
65926
|
+
(w = this.PDF) == null || w.deletePage(1);
|
|
65927
|
+
else C <= 1 && ((v = this.PDF) == null || v.deletePage(1));
|
|
65928
|
+
let _ = "";
|
|
65929
|
+
r == "url" ? _ = this.PDF.output("bloburl") : _ = this.PDF.output("datauristring"), t && o.vueController.waitLoadImageCount(() => {
|
|
65930
|
+
t({
|
|
65931
|
+
page: g,
|
|
65932
|
+
pdf: _.replace(/^data:application\/pdf;filename=generated.pdf;base64,/, "")
|
|
65933
|
+
});
|
|
65934
|
+
}), y(_);
|
|
65935
|
+
} else
|
|
65936
|
+
t && o.vueController.waitLoadImageCount(() => {
|
|
65937
|
+
t({
|
|
65938
|
+
page: g,
|
|
65939
|
+
pdf: ""
|
|
65940
|
+
});
|
|
65941
|
+
}), y("");
|
|
65929
65942
|
});
|
|
65930
65943
|
})));
|
|
65931
|
-
return
|
|
65944
|
+
return m ? (setTimeout(() => {
|
|
65932
65945
|
(o.drawTree.drawPages || []).length && o.vueController.moveCaretToPath(n), this.clearJsPDF();
|
|
65933
|
-
}, 0), r == "url" ?
|
|
65946
|
+
}, 0), r == "url" ? m : m.replace(/^data:application\/pdf;filename=generated.pdf;base64,/, "")) : null;
|
|
65934
65947
|
}
|
|
65935
65948
|
/**
|
|
65936
65949
|
* 加载字体
|
|
@@ -72206,6 +72219,8 @@ class HOEditorFactory {
|
|
|
72206
72219
|
// 元素是否默认可以被删除
|
|
72207
72220
|
b(this, "_loadImageCount", 0);
|
|
72208
72221
|
// 待加载的图片数量
|
|
72222
|
+
b(this, "_loadImageErrorCount", 0);
|
|
72223
|
+
// 加载错误数量
|
|
72209
72224
|
b(this, "_loadImageCallback", null);
|
|
72210
72225
|
// 图片加载完成回调
|
|
72211
72226
|
b(this, "_aiTextFunc", null);
|
|
@@ -72634,6 +72649,12 @@ class HOEditorFactory {
|
|
|
72634
72649
|
set loadImageCount(t) {
|
|
72635
72650
|
this._loadImageCount !== t && (this._loadImageCount = t), this._loadImageCount <= 0 && this._loadImageCallback && (this._loadImageCallback(), this._loadImageCallback = null);
|
|
72636
72651
|
}
|
|
72652
|
+
get loadImageErrorCount() {
|
|
72653
|
+
return this._loadImageErrorCount;
|
|
72654
|
+
}
|
|
72655
|
+
set loadImageErrorCount(t) {
|
|
72656
|
+
this._loadImageErrorCount !== t && (this._loadImageErrorCount = t);
|
|
72657
|
+
}
|
|
72637
72658
|
set loadImageCallback(t) {
|
|
72638
72659
|
this._loadImageCallback = t;
|
|
72639
72660
|
}
|