hoeditor-web 3.2.95 → 3.2.96

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-lkktgSNV.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-C9W5HdA6.mjs";
3
3
  export {
4
4
  i as HoDocs,
5
5
  r as HoEditorProvide,
@@ -15183,7 +15183,7 @@ class DrawSignNode extends DrawCombineNode {
15183
15183
  }
15184
15184
  }
15185
15185
  }
15186
- const version = "3.2.95";
15186
+ const version = "3.2.96";
15187
15187
  var FingerPosition = /* @__PURE__ */ ((a) => (a[a.left = 0] = "left", a[a.center = 1] = "center", a[a.right = 2] = "right", a))(FingerPosition || {});
15188
15188
  class SignNode extends BaseNode {
15189
15189
  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) {
@@ -23319,6 +23319,23 @@ const appendPrevTextResult = (a, t, r) => {
23319
23319
  }, o = !1;
23320
23320
  }
23321
23321
  return r;
23322
+ }, deepCloneWithWhiteList = (a, t) => {
23323
+ if (a === null || typeof a != "object")
23324
+ return a;
23325
+ if (Array.isArray(a))
23326
+ return a.map((n) => deepCloneWithWhiteList(n, t));
23327
+ if (a instanceof Date)
23328
+ return new Date(a.getTime());
23329
+ if (a instanceof RegExp)
23330
+ return new RegExp(a.source, a.flags);
23331
+ const r = {}, o = t || Object.keys(a);
23332
+ for (const n of o)
23333
+ if (n in a) {
23334
+ const s = Object.getOwnPropertyDescriptor(a, n);
23335
+ let l;
23336
+ s && s.get, l = a[n], l !== void 0 && (r[n] = deepCloneWithWhiteList(l, t));
23337
+ }
23338
+ return r;
23322
23339
  };
23323
23340
  var ReadOnlyStatus = /* @__PURE__ */ ((a) => (a[a.true = 0] = "true", a[a.false = 1] = "false", a[a.InheritParentElement = 2] = "InheritParentElement", a))(ReadOnlyStatus || {}), InputFieldType = /* @__PURE__ */ ((a) => (a[a.text = 0] = "text", a[a.dropDownList = 1] = "dropDownList", a))(InputFieldType || {});
23324
23341
  class DownListProperty {
@@ -45639,22 +45656,22 @@ class StructureConvert {
45639
45656
  doc2Json(t, r, o, n) {
45640
45657
  const s = HOEditorFactorys.instance().getFactory(this._hoEditorFactoryID), l = new X2JS({ stripWhitespaces: !1, arrayAccessForm: "property" }), c = (f, p) => s.compressXml ? (s.compressJSONData[f] = p, {}) : p;
45641
45658
  if (t === "docProperty") {
45642
- const f = s.docTree.docProperty, p = JSON.parse(JSON.stringify(f, DocProperty.whiteList()));
45659
+ const f = s.docTree.docProperty, p = deepCloneWithWhiteList(f, DocProperty.whiteList());
45643
45660
  return c(t, p);
45644
45661
  }
45645
45662
  if (t === "pageSettings") {
45646
- const f = s.pageProperty, p = JSON.parse(JSON.stringify(f, PageProperty.whiteList()));
45663
+ const f = s.pageProperty, p = deepCloneWithWhiteList(f, PageProperty.whiteList());
45647
45664
  return c(t, p);
45648
45665
  }
45649
45666
  if (t === "styles") {
45650
- const f = [], p = s.docTree.styles, m = p[0].combineStyle, g = JSON.parse(JSON.stringify(m, CombineStyle.whiteList()));
45667
+ const f = [], p = s.docTree.styles, m = p[0].combineStyle, g = deepCloneWithWhiteList(m, CombineStyle.whiteList());
45651
45668
  for (let _ = 1; _ < p.length; _++) {
45652
- const D = p[_], E = D.combineStyle, T = JSON.parse(JSON.stringify(E, CombineStyle.whiteList()));
45669
+ const D = p[_], E = D.combineStyle, T = deepCloneWithWhiteList(E, CombineStyle.whiteList());
45653
45670
  (D.size === void 0 || D.size === m.size) && delete T.size, (D.font === void 0 || D.font === m.font) && delete T.font, (D.color === void 0 || D.color === m.color) && delete T.color, (D.backColor === void 0 || D.backColor === m.backColor) && delete T.backColor, (D.bold === void 0 || D.bold === m.bold) && delete T.bold, (D.italic === void 0 || D.italic === m.italic) && delete T.italic, (D.underline === void 0 || D.underline === m.underline) && delete T.underline, (D.strikeout === void 0 || D.strikeout === m.strikeout) && delete T.strikeout, (D.script === void 0 || D.script === m.script) && delete T.script, (D.deleterIndex === -1 || D.deleterIndex === void 0 || D.deleterIndex === m.deleterIndex) && delete T.deleterIndex, (D.creatorIndex === -1 || D.creatorIndex === void 0 || D.creatorIndex === m.creatorIndex) && delete T.creatorIndex, (D.modifierIndex === -1 || D.modifierIndex === void 0 || D.modifierIndex === m.modifierIndex) && delete T.modifierIndex, n && D.commentID !== "0" && D.commentID !== void 0 && (D.commentID = "0"), (D.commentID === "0" || D.commentID === void 0 || D.commentID === m.commentID) && delete T.commentID, f.push(T);
45654
45671
  }
45655
- const y = [], v = s.docTree.paragraphs, w = v[0].combineStyle, C = JSON.parse(JSON.stringify(w, CombineParagraph.whiteList()));
45672
+ const y = [], v = s.docTree.paragraphs, w = v[0].combineStyle, C = deepCloneWithWhiteList(w, CombineParagraph.whiteList());
45656
45673
  for (let _ = 1; _ < v.length; _++) {
45657
- const D = v[_], E = D.combineStyle, T = JSON.parse(JSON.stringify(E, CombineParagraph.whiteList()));
45674
+ const D = v[_], E = D.combineStyle, T = deepCloneWithWhiteList(E, CombineParagraph.whiteList());
45658
45675
  (D.charSpace === void 0 || D.charSpace === w.charSpace) && delete T.charSpace, (D.lineSpace === void 0 || D.lineSpace === w.lineSpace) && delete T.lineSpace, (D.leftMargin === void 0 || D.leftMargin === w.leftMarginMm) && delete T.leftMarginMm, (D.rightMargin === void 0 || D.rightMargin === w.rightMarginMm) && delete T.rightMarginMm, (D.topMargin === void 0 || D.topMargin === w.topMarginMm) && delete T.topMarginMm, (D.bottomMargin === void 0 || D.bottomMargin === w.bottomMarginMm) && delete T.bottomMarginMm, (D.align === void 0 || D.align === w.align) && delete T.align, (D.firstIndent === void 0 || D.firstIndent === w.firstIndent) && delete T.firstIndent, y.push(T);
45659
45676
  }
45660
45677
  return c(t, {
@@ -45667,14 +45684,14 @@ class StructureConvert {
45667
45684
  if (t === "comments") {
45668
45685
  const f = [];
45669
45686
  return n || s.drawTree.commentsMap.forEach((m) => {
45670
- const g = JSON.parse(JSON.stringify(m, Comment.whiteList()));
45687
+ const g = deepCloneWithWhiteList(m, Comment.whiteList());
45671
45688
  g.customProperty = m.customProperty, f.push(g);
45672
45689
  }), c(t, { comment: f });
45673
45690
  }
45674
45691
  if (t === "userHistories") {
45675
45692
  const f = [], p = s.docTree.userHistories;
45676
45693
  for (let m = 0; m < p.length; m++) {
45677
- const g = p[m], y = JSON.parse(JSON.stringify(g, UserHistory.whiteList()));
45694
+ const g = p[m], y = deepCloneWithWhiteList(g, UserHistory.whiteList());
45678
45695
  f.push(y);
45679
45696
  }
45680
45697
  return c(t, { userHistory: f });
@@ -64957,7 +64974,7 @@ WebPDecoder.prototype.getData = function() {
64957
64974
  (function(a) {
64958
64975
  function t() {
64959
64976
  return function() {
64960
- return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-aN5RyHua.mjs");
64977
+ return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-DUUD2iss.mjs");
64961
64978
  }().catch(function(r) {
64962
64979
  return Promise.reject(new Error("Could not load canvg: " + r));
64963
64980
  }).then(function(r) {
@@ -1,4 +1,4 @@
1
- import { c as Da, _ as Va, g as il } from "./index-lkktgSNV.mjs";
1
+ import { c as Da, _ as Va, g as il } from "./index-C9W5HdA6.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.95",
3
+ "version": "3.2.96",
4
4
  "private": false,
5
5
  "main": "lib/hoeditor.mjs",
6
6
  "typings": "types/index.d.ts",