hoeditor-web 3.2.77 → 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-BYjwmhG8.mjs";
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.77";
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) {
@@ -52454,6 +52454,10 @@ class VueController {
52454
52454
  getElementTrackingRecords() {
52455
52455
  return HOEditorFactorys.instance().getFactory(this._hoEditorFactoryID).docTree.elementTrackingRecords;
52456
52456
  }
52457
+ cleatElementTrackingRecords() {
52458
+ const t = HOEditorFactorys.instance().getFactory(this._hoEditorFactoryID);
52459
+ t.docTree.elementTrackingRecords && t.docTree.elementTrackingRecords.clear(), t.docTree.elementChangeRecords = /* @__PURE__ */ new Map();
52460
+ }
52457
52461
  getElementChangeRecords() {
52458
52462
  const t = HOEditorFactorys.instance().getFactory(this._hoEditorFactoryID), r = new Array(), o = t.docTree.elementChangeRecords;
52459
52463
  let n = new Object();
@@ -52493,7 +52497,7 @@ class VueController {
52493
52497
  }
52494
52498
  cleatElementChangeRecords() {
52495
52499
  const t = HOEditorFactorys.instance().getFactory(this._hoEditorFactoryID);
52496
- t.docTree.elementChangeRecords && t.docTree.elementChangeRecords.clear(), t.docTree.elementChangeRecords = /* @__PURE__ */ new Map(), t.docTree.elementTrackingRecords.clear(), t.docTree.elementTrackingRecords = /* @__PURE__ */ new Map();
52500
+ t.docTree.elementChangeRecords && t.docTree.elementChangeRecords.clear(), t.docTree.elementChangeRecords = /* @__PURE__ */ new Map();
52497
52501
  }
52498
52502
  //获取前一个有效单元格
52499
52503
  getPreCell(t) {
@@ -52647,7 +52651,7 @@ class VueController {
52647
52651
  text: d.text,
52648
52652
  nodeType: "ntText",
52649
52653
  path: this.getPathByNode(d)
52650
- }) : d instanceof TextInputFieldNode && s(d.childNodes);
52654
+ }) : d.childNodes && d.childNodes.length && s(d.childNodes);
52651
52655
  }
52652
52656
  };
52653
52657
  return s(r.docTree.mainNodes), t;
@@ -64615,7 +64619,7 @@ WebPDecoder.prototype.getData = function() {
64615
64619
  (function(a) {
64616
64620
  function t() {
64617
64621
  return function() {
64618
- return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-TPkxtLfY.mjs");
64622
+ return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-CyxgRuIp.mjs");
64619
64623
  }().catch(function(r) {
64620
64624
  return Promise.reject(new Error("Could not load canvg: " + r));
64621
64625
  }).then(function(r) {
@@ -65893,7 +65897,9 @@ class PrintController {
65893
65897
  async createBase64(t, r) {
65894
65898
  if (!this._isSetFont)
65895
65899
  return;
65896
- const o = HOEditorFactorys.instance().getFactory(this._hoEditorFactoryID), 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 = {
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 = {
65897
65903
  orientation: c,
65898
65904
  unit: "px",
65899
65905
  format: d,
@@ -65902,31 +65908,42 @@ class PrintController {
65902
65908
  };
65903
65909
  this.clearJsPDF(), this.PDF = new jsPDF(u);
65904
65910
  let f = Promise.resolve();
65905
- f = f.then(() => new Promise((m) => {
65906
- o.printStatus.printMode = 0, o.drawTree.paintStatus = PaintState.psPreview, o.drawTree.rebuildAllDrawLine(!1, m, !1);
65907
- })), f = f.then(() => new Promise((m) => {
65908
- Print.createPDFBase64(this._hoEditorFactoryID, m, this.PDF);
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);
65909
65918
  }));
65910
- const p = await f.then((m) => (o.drawTree.paintStatus = s, new Promise((g) => {
65919
+ const m = await f.then((g) => (o.drawTree.paintStatus = s, new Promise((y) => {
65911
65920
  o.vueController.openXml(l).then(() => {
65912
- var v, C;
65913
- const y = this.PDF.internal.getNumberOfPages() - m;
65914
- if (y >= 2)
65915
- for (let _ = 0; _ < y; _++)
65916
- (v = this.PDF) == null || v.deletePage(1);
65917
- else y <= 1 && ((C = this.PDF) == null || C.deletePage(1));
65918
- let w = "";
65919
- r == "url" ? w = this.PDF.output("bloburl") : w = this.PDF.output("datauristring"), t && o.vueController.waitLoadImageCount(() => {
65920
- t({
65921
- page: m,
65922
- pdf: w.replace(/^data:application\/pdf;filename=generated.pdf;base64,/, "")
65923
- });
65924
- }), g(w);
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("");
65925
65942
  });
65926
65943
  })));
65927
- return p ? (setTimeout(() => {
65944
+ return m ? (setTimeout(() => {
65928
65945
  (o.drawTree.drawPages || []).length && o.vueController.moveCaretToPath(n), this.clearJsPDF();
65929
- }, 0), r == "url" ? p : p.replace(/^data:application\/pdf;filename=generated.pdf;base64,/, "")) : null;
65946
+ }, 0), r == "url" ? m : m.replace(/^data:application\/pdf;filename=generated.pdf;base64,/, "")) : null;
65930
65947
  }
65931
65948
  /**
65932
65949
  * 加载字体
@@ -72202,6 +72219,8 @@ class HOEditorFactory {
72202
72219
  // 元素是否默认可以被删除
72203
72220
  b(this, "_loadImageCount", 0);
72204
72221
  // 待加载的图片数量
72222
+ b(this, "_loadImageErrorCount", 0);
72223
+ // 加载错误数量
72205
72224
  b(this, "_loadImageCallback", null);
72206
72225
  // 图片加载完成回调
72207
72226
  b(this, "_aiTextFunc", null);
@@ -72630,6 +72649,12 @@ class HOEditorFactory {
72630
72649
  set loadImageCount(t) {
72631
72650
  this._loadImageCount !== t && (this._loadImageCount = t), this._loadImageCount <= 0 && this._loadImageCallback && (this._loadImageCallback(), this._loadImageCallback = null);
72632
72651
  }
72652
+ get loadImageErrorCount() {
72653
+ return this._loadImageErrorCount;
72654
+ }
72655
+ set loadImageErrorCount(t) {
72656
+ this._loadImageErrorCount !== t && (this._loadImageErrorCount = t);
72657
+ }
72633
72658
  set loadImageCallback(t) {
72634
72659
  this._loadImageCallback = t;
72635
72660
  }
@@ -1,4 +1,4 @@
1
- import { c as Da, _ as Va, g as il } from "./index-BYjwmhG8.mjs";
1
+ import { c as Da, _ as Va, g as il } from "./index-RSacoGIm.mjs";
2
2
  var fn = {}, cn = {}, cr, vn;
3
3
  function Q() {
4
4
  if (vn) return cr;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hoeditor-web",
3
- "version": "3.2.77",
3
+ "version": "3.2.79",
4
4
  "private": false,
5
5
  "main": "lib/hoeditor.mjs",
6
6
  "typings": "types/index.d.ts",