hoeditor-web 3.2.94 → 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-
|
|
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.
|
|
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 {
|
|
@@ -31401,6 +31418,14 @@ class DocTree {
|
|
|
31401
31418
|
n.docTree.curParaNo
|
|
31402
31419
|
), d = this.insertNodeAfterPath(d, u)), n.docTree.insertNodeAfterPath(d, r), this.getNodeLastPath(c);
|
|
31403
31420
|
}
|
|
31421
|
+
isSameCombineStyle(t, r) {
|
|
31422
|
+
const o = t instanceof CombineStyle ? CombineStyle.whiteList() : CombineParagraph.whiteList();
|
|
31423
|
+
if (t === r) return !0;
|
|
31424
|
+
for (const n of o)
|
|
31425
|
+
if (t[n] !== r[n])
|
|
31426
|
+
return !1;
|
|
31427
|
+
return !0;
|
|
31428
|
+
}
|
|
31404
31429
|
/**
|
|
31405
31430
|
* 文字样式,段落样式比较
|
|
31406
31431
|
* @param 新样式
|
|
@@ -31412,14 +31437,14 @@ class DocTree {
|
|
|
31412
31437
|
if (t instanceof TextStyle) {
|
|
31413
31438
|
for (let o = 0; o < this.styles.length; o++) {
|
|
31414
31439
|
const n = this.styles[o];
|
|
31415
|
-
if (
|
|
31440
|
+
if (this.isSameCombineStyle(n.combineStyle, t.combineStyle))
|
|
31416
31441
|
return r = o, r;
|
|
31417
31442
|
}
|
|
31418
31443
|
r === -1 && (this.styles.push(t), r = this.styles.length - 1);
|
|
31419
31444
|
} else if (t instanceof Paragraph) {
|
|
31420
31445
|
for (let o = 0; o < this.paragraphs.length; o++) {
|
|
31421
31446
|
const n = this.paragraphs[o];
|
|
31422
|
-
if (
|
|
31447
|
+
if (this.isSameCombineStyle(n.combineStyle, t.combineStyle))
|
|
31423
31448
|
return r = o, r;
|
|
31424
31449
|
}
|
|
31425
31450
|
r === -1 && (this.paragraphs.push(t), r = this.paragraphs.length - 1);
|
|
@@ -45631,22 +45656,22 @@ class StructureConvert {
|
|
|
45631
45656
|
doc2Json(t, r, o, n) {
|
|
45632
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;
|
|
45633
45658
|
if (t === "docProperty") {
|
|
45634
|
-
const f = s.docTree.docProperty, p =
|
|
45659
|
+
const f = s.docTree.docProperty, p = deepCloneWithWhiteList(f, DocProperty.whiteList());
|
|
45635
45660
|
return c(t, p);
|
|
45636
45661
|
}
|
|
45637
45662
|
if (t === "pageSettings") {
|
|
45638
|
-
const f = s.pageProperty, p =
|
|
45663
|
+
const f = s.pageProperty, p = deepCloneWithWhiteList(f, PageProperty.whiteList());
|
|
45639
45664
|
return c(t, p);
|
|
45640
45665
|
}
|
|
45641
45666
|
if (t === "styles") {
|
|
45642
|
-
const f = [], p = s.docTree.styles, m = p[0].combineStyle, g =
|
|
45667
|
+
const f = [], p = s.docTree.styles, m = p[0].combineStyle, g = deepCloneWithWhiteList(m, CombineStyle.whiteList());
|
|
45643
45668
|
for (let _ = 1; _ < p.length; _++) {
|
|
45644
|
-
const D = p[_], E = D.combineStyle, T =
|
|
45669
|
+
const D = p[_], E = D.combineStyle, T = deepCloneWithWhiteList(E, CombineStyle.whiteList());
|
|
45645
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);
|
|
45646
45671
|
}
|
|
45647
|
-
const y = [], v = s.docTree.paragraphs, w = v[0].combineStyle, C =
|
|
45672
|
+
const y = [], v = s.docTree.paragraphs, w = v[0].combineStyle, C = deepCloneWithWhiteList(w, CombineParagraph.whiteList());
|
|
45648
45673
|
for (let _ = 1; _ < v.length; _++) {
|
|
45649
|
-
const D = v[_], E = D.combineStyle, T =
|
|
45674
|
+
const D = v[_], E = D.combineStyle, T = deepCloneWithWhiteList(E, CombineParagraph.whiteList());
|
|
45650
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);
|
|
45651
45676
|
}
|
|
45652
45677
|
return c(t, {
|
|
@@ -45659,14 +45684,14 @@ class StructureConvert {
|
|
|
45659
45684
|
if (t === "comments") {
|
|
45660
45685
|
const f = [];
|
|
45661
45686
|
return n || s.drawTree.commentsMap.forEach((m) => {
|
|
45662
|
-
const g =
|
|
45687
|
+
const g = deepCloneWithWhiteList(m, Comment.whiteList());
|
|
45663
45688
|
g.customProperty = m.customProperty, f.push(g);
|
|
45664
45689
|
}), c(t, { comment: f });
|
|
45665
45690
|
}
|
|
45666
45691
|
if (t === "userHistories") {
|
|
45667
45692
|
const f = [], p = s.docTree.userHistories;
|
|
45668
45693
|
for (let m = 0; m < p.length; m++) {
|
|
45669
|
-
const g = p[m], y =
|
|
45694
|
+
const g = p[m], y = deepCloneWithWhiteList(g, UserHistory.whiteList());
|
|
45670
45695
|
f.push(y);
|
|
45671
45696
|
}
|
|
45672
45697
|
return c(t, { userHistory: f });
|
|
@@ -64949,7 +64974,7 @@ WebPDecoder.prototype.getData = function() {
|
|
|
64949
64974
|
(function(a) {
|
|
64950
64975
|
function t() {
|
|
64951
64976
|
return function() {
|
|
64952
|
-
return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-
|
|
64977
|
+
return globalObject.canvg ? Promise.resolve(globalObject.canvg) : import("./index.es-DUUD2iss.mjs");
|
|
64953
64978
|
}().catch(function(r) {
|
|
64954
64979
|
return Promise.reject(new Error("Could not load canvg: " + r));
|
|
64955
64980
|
}).then(function(r) {
|