Updated react-pdf dependency (#3342)

This commit is contained in:
Alex
2024-05-10 09:11:09 -06:00
committed by GitHub
parent 1058efb17a
commit 9e0a0205cc
3 changed files with 133 additions and 213 deletions

View File

@@ -512,9 +512,7 @@
finishWorkerTask(i);
s &&
(0, r.info)(
`page=${n + 1} - getOperatorList: time=${
Date.now() - s
}ms, len=${e.length}`,
`page=${n + 1} - getOperatorList: time=${Date.now() - s}ms, len=${e.length}`,
);
t.close();
},
@@ -5086,10 +5084,7 @@
this.backgroundColor &&
(s = `${(0, i.getPdfColor)(this.backgroundColor, !0)} ${n} f `);
if (this.borderColor) {
s += `${this.borderStyle.width || 1} w ${(0, i.getPdfColor)(
this.borderColor,
!1,
)} ${n} S `;
s += `${this.borderStyle.width || 1} w ${(0, i.getPdfColor)(this.borderColor, !1)} ${n} S `;
}
return s;
}
@@ -5372,23 +5367,12 @@
return (
`/Tx BMC q ${h}BT ` +
p +
` 1 0 0 1 ${(0, n.numberToString)(2)} ${(0, n.numberToString)(
v,
)} Tm (${(0, n.escapeString)(w[0])}) Tj ET Q EMC`
` 1 0 0 1 ${(0, n.numberToString)(2)} ${(0, n.numberToString)(v)} Tm (${(0, n.escapeString)(w[0])}) Tj ET Q EMC`
);
return (
`/Tx BMC q ${h}BT ` +
p +
` 1 0 0 1 0 0 Tm ${this._renderText(
w[0],
y,
m,
g,
k,
{ shift: 0 },
2,
v,
)} ET Q EMC`
` 1 0 0 1 0 0 Tm ${this._renderText(w[0], y, m, g, k, { shift: 0 }, 2, v)} ET Q EMC`
);
}
static async _getFontData(e, t, a, r) {
@@ -5470,8 +5454,7 @@
} else l = o;
const h = (0, n.numberToString)(l - s.shift);
s.shift = l;
return `${h} ${(c = (0, n.numberToString)(c))} Td (${(0,
n.escapeString)(e)}) Tj`;
return `${h} ${(c = (0, n.numberToString)(c))} Td (${(0, n.escapeString)(e)}) Tj`;
}
_getSaveFieldResources(e) {
const {
@@ -5547,9 +5530,7 @@
return (
`/Tx BMC q ${f}BT ` +
e +
` 1 0 0 1 ${(0, n.numberToString)(o)} ${(0, n.numberToString)(
c + l,
)} Tm ${m} ET Q EMC`
` 1 0 0 1 ${(0, n.numberToString)(o)} ${(0, n.numberToString)(c + l)} Tm ${m} ET Q EMC`
);
}
_getMultilineAppearance(e, t, a, r, i, s, o, c, l, h, u, d) {
@@ -5788,11 +5769,7 @@
(0, r.unreachable)(
`_getDefaultCheckedAppearance - unsupported type: ${t}`,
);
const d = `q BT /PdfJsZaDb ${l} Tf 0 g ${(0, n.numberToString)(
(a - h.width) / 2,
)} ${(0, n.numberToString)(
(i - h.height) / 2,
)} Td (${u}) Tj ET Q`,
const d = `q BT /PdfJsZaDb ${l} Tf 0 g ${(0, n.numberToString)((a - h.width) / 2)} ${(0, n.numberToString)((i - h.height) / 2)} Td (${u}) Tj ET Q`,
f = new s.Dict(e.xref);
f.set("FormType", 1);
f.set("Subtype", s.Name.get("Form"));
@@ -6631,9 +6608,7 @@
for (const { bezier: e } of l) {
f.length = 0;
f.push(
`${(0, n.numberToString)(e[0])} ${(0, n.numberToString)(
e[1],
)} m`,
`${(0, n.numberToString)(e[0])} ${(0, n.numberToString)(e[1])} m`,
);
for (let t = 2, a = e.length; t < a; t += 6) {
const a = e
@@ -7280,13 +7255,9 @@
const v = s * Math.min(w, S),
F = [
"q",
`0 0 ${(0, n.numberToString)(b)} ${(0, n.numberToString)(
y,
)} re W n`,
`0 0 ${(0, n.numberToString)(b)} ${(0, n.numberToString)(y)} re W n`,
"BT",
`1 0 0 1 0 ${(0, n.numberToString)(
y + C,
)} Tm 0 Tc ${getPdfColor(o, !0)}`,
`1 0 0 1 0 ${(0, n.numberToString)(y + C)} Tm 0 Tc ${getPdfColor(o, !0)}`,
`/${this.fontName.name} ${(0, n.numberToString)(v)} Tf`,
],
{ resources: O } = this;
@@ -12816,9 +12787,7 @@
const e = s.peekBytes(a + 1)[a];
if (!(0, i.isWhiteSpace)(e)) break;
(0, r.info)(
`Found "${(0, r.bytesToString)(
c,
)}" when searching for endstream command.`,
`Found "${(0, r.bytesToString)(c)}" when searching for endstream command.`,
);
t = l;
break;
@@ -12977,9 +12946,7 @@
e = this.nextChar();
}
if (e < 48 || e > 57) {
const t = `Invalid number: ${String.fromCharCode(
e,
)} (charCode ${e})`;
const t = `Invalid number: ${String.fromCharCode(e)} (charCode ${e})`;
if ((0, i.isWhiteSpace)(e) || -1 === e) {
(0, r.info)(`Lexer.getNumber - "${t}".`);
return 0;
@@ -13126,9 +13093,7 @@
const i = toHexDigit(e);
if (-1 === i) {
(0, r.warn)(
`Lexer_getName: Illegal digit (${String.fromCharCode(
e,
)}) in hexadecimal number.`,
`Lexer_getName: Illegal digit (${String.fromCharCode(e)}) in hexadecimal number.`,
);
a.push("#", String.fromCharCode(t));
if (b[e]) break;
@@ -46911,9 +46876,7 @@
} else
this.nodeValue
? e.push(
`>${(0, r.encodeToXmlString)(this.nodeValue)}</${
this.nodeName
}>`,
`>${(0, r.encodeToXmlString)(this.nodeValue)}</${this.nodeName}>`,
)
: e.push("/>");
} else e.push((0, r.encodeToXmlString)(this.nodeValue));
@@ -51254,9 +51217,7 @@
const t = (0, s.toStyle)(this, "border", "margin"),
a = this[r.$getParent]()[r.$getParent](),
n = {
fontSize: `calc(${
a.font?.size || 10
}px * var(--scale-factor))`,
fontSize: `calc(${a.font?.size || 10}px * var(--scale-factor))`,
},
i = [];
if (a.items.children.length > 0) {
@@ -53129,11 +53090,7 @@
}
[r.$toStyle](e) {
e = e ? e[r.$toStyle]() : "#FFFFFF";
return `linear-gradient(${this.type
.replace(/([RBLT])/, " $1")
.toLowerCase()}, ${e}, ${
this.color ? this.color[r.$toStyle]() : "#000000"
})`;
return `linear-gradient(${this.type.replace(/([RBLT])/, " $1").toLowerCase()}, ${e}, ${this.color ? this.color[r.$toStyle]() : "#000000"})`;
}
}
class LockDocument extends o.ContentObject {
@@ -53872,9 +53829,7 @@
[r.$toStyle](e) {
e = e ? e[r.$toStyle]() : "#FFFFFF";
const t = this.color ? this.color[r.$toStyle]() : "#000000";
return `radial-gradient(circle at center, ${
"toEdge" === this.type ? `${e},${t}` : `${t},${e}`
})`;
return `radial-gradient(circle at center, ${"toEdge" === this.type ? `${e},${t}` : `${t},${e}`})`;
}
}
class Reason extends o.StringObject {
@@ -56767,9 +56722,7 @@
? (n = ` (id: ${this.id})`)
: this.name && (n = ` (name: ${this.name} ${this.h.value})`);
(0, i.warn)(
`XFA - node "${
this[r.$nodeName]
}"${n} has already enough "${t}"!`,
`XFA - node "${this[r.$nodeName]}"${n} has already enough "${t}"!`,
);
return !1;
}
@@ -56990,9 +56943,7 @@
}
if (s[r.$nodeName] !== this[r.$nodeName]) {
(0, i.warn)(
`XFA - Incompatible prototype: ${s[r.$nodeName]} !== ${
this[r.$nodeName]
}.`,
`XFA - Incompatible prototype: ${s[r.$nodeName]} !== ${this[r.$nodeName]}.`,
);
return null;
}
@@ -57123,9 +57074,7 @@
return !0;
}
(0, i.warn)(
`XFA - node "${e[r.$nodeName]}" accepts no more than ${
this[S]
} children`,
`XFA - node "${e[r.$nodeName]}" accepts no more than ${this[S]} children`,
);
return !1;
}
@@ -60108,16 +60057,12 @@
[
"xfa-font-horizontal-scale",
(e) =>
`scaleX(${Math.max(0, Math.min(parseInt(e) / 100)).toFixed(
2,
)})`,
`scaleX(${Math.max(0, Math.min(parseInt(e) / 100)).toFixed(2)})`,
],
[
"xfa-font-vertical-scale",
(e) =>
`scaleY(${Math.max(0, Math.min(parseInt(e) / 100)).toFixed(
2,
)})`,
`scaleY(${Math.max(0, Math.min(parseInt(e) / 100)).toFixed(2)})`,
],
["xfa-spacerun", ""],
["xfa-tab-stops", ""],