@silurus/ooxml 0.43.0 → 0.44.0
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/README.md +5 -1
- package/dist/docx-CzKuShC2.cjs +1 -0
- package/dist/docx-_3T8T0_d.js +1271 -0
- package/dist/docx.cjs +1 -1
- package/dist/docx.mjs +2 -2
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{pptx-BmIUjNvr.js → pptx-BAMK-lOf.js} +38 -40
- package/dist/pptx-BOX6X30i.cjs +1 -0
- package/dist/pptx.cjs +1 -1
- package/dist/pptx.mjs +2 -2
- package/dist/src-CR3VN7Rg.js +2623 -0
- package/dist/src-UNEkXXS6.cjs +1 -0
- package/dist/types/docx.d.ts +111 -1
- package/dist/types/index.d.ts +111 -1
- package/dist/{xlsx-Bd44HD4a.js → xlsx-CFBzfhol.js} +562 -647
- package/dist/xlsx-pyaGcLeD.cjs +11 -0
- package/dist/xlsx.cjs +1 -1
- package/dist/xlsx.mjs +2 -2
- package/package.json +3 -2
- package/dist/autoResize-C6N7p_Or.cjs +0 -1
- package/dist/autoResize-D-Yz7Izt.js +0 -70
- package/dist/docx-B-XLTFsD.js +0 -1171
- package/dist/docx-BL1W9RcN.cjs +0 -1
- package/dist/pptx-CpcYbH-I.cjs +0 -1
- package/dist/preset-D4KAeT8N.js +0 -1276
- package/dist/preset-DX23kV7c.cjs +0 -1
- package/dist/renderer-Dy1T2soN.cjs +0 -1
- package/dist/renderer-SjpGWvxf.js +0 -1024
- package/dist/xlsx-CE2KLjqR.cjs +0 -11
package/dist/docx.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./src-UNEkXXS6.cjs`),t=require(`./docx-CzKuShC2.cjs`);exports.DocxDocument=t.r,exports.DocxViewer=t.n,exports.autoResize=e.d;
|
package/dist/docx.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as t, r as n } from "./docx-
|
|
1
|
+
import { d as e } from "./src-CR3VN7Rg.js";
|
|
2
|
+
import { n as t, r as n } from "./docx-_3T8T0_d.js";
|
|
3
3
|
export { n as DocxDocument, t as DocxViewer, e as autoResize };
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./pptx-BOX6X30i.cjs`),t=require(`./xlsx-pyaGcLeD.cjs`),n=require(`./docx-CzKuShC2.cjs`);Object.defineProperty(exports,`docx`,{enumerable:!0,get:function(){return n.t}}),Object.defineProperty(exports,`pptx`,{enumerable:!0,get:function(){return e.t}}),Object.defineProperty(exports,`xlsx`,{enumerable:!0,get:function(){return t.t}});
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./
|
|
2
|
-
import { t } from "./
|
|
3
|
-
import { t as n } from "./docx-
|
|
4
|
-
export { n as docx,
|
|
1
|
+
import { t as e } from "./pptx-BAMK-lOf.js";
|
|
2
|
+
import { t } from "./xlsx-CFBzfhol.js";
|
|
3
|
+
import { t as n } from "./docx-_3T8T0_d.js";
|
|
4
|
+
export { n as docx, e as pptx, t as xlsx };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as r } from "./renderer-SjpGWvxf.js";
|
|
3
|
-
import { a as i, i as a, n as o, r as s, t as c } from "./preset-D4KAeT8N.js";
|
|
1
|
+
import { c as e, d as t, f as n, l as r, m as i, o as a, p as o, s, u as c } from "./src-CR3VN7Rg.js";
|
|
4
2
|
//#region packages/pptx/src/media-chrome.ts
|
|
5
3
|
function l(e, t, n, r, i, a) {
|
|
6
4
|
let o = Math.max(18, Math.min(32, Math.min(r, i) * .25));
|
|
@@ -22093,12 +22091,12 @@ var x = 12700;
|
|
|
22093
22091
|
function S(e, t) {
|
|
22094
22092
|
return e * t;
|
|
22095
22093
|
}
|
|
22096
|
-
var C =
|
|
22094
|
+
var C = e;
|
|
22097
22095
|
function w(e) {
|
|
22098
22096
|
return !e || e.fillType === "none" ? null : e.fillType === "solid" ? C(e.color) : e.fillType === "gradient" ? e.stops.length > 0 ? C(e.stops[0].color) : null : e.fillType === "pattern" ? C(e.fg) : null;
|
|
22099
22097
|
}
|
|
22100
|
-
function T(e, t, n,
|
|
22101
|
-
return
|
|
22098
|
+
function T(e, t, n, i, a, o) {
|
|
22099
|
+
return r(e, t, n, i, a, o);
|
|
22102
22100
|
}
|
|
22103
22101
|
function E(e, t, n, r, i, a, o) {
|
|
22104
22102
|
let s = Math.max(1, i * .05), c = o?.endsWith("Heavy") ?? !1 ? s * 1.8 : s, l = n + Math.max(2, c);
|
|
@@ -22360,20 +22358,20 @@ function z(e, t, n, r, i, a, o) {
|
|
|
22360
22358
|
default: return null;
|
|
22361
22359
|
}
|
|
22362
22360
|
}
|
|
22363
|
-
function B(e, t, n, r = "#000000", i,
|
|
22361
|
+
function B(e, t, n, r = "#000000", i, o = {
|
|
22364
22362
|
themeMajorFont: null,
|
|
22365
22363
|
themeMinorFont: null
|
|
22366
|
-
},
|
|
22367
|
-
let
|
|
22364
|
+
}, s) {
|
|
22365
|
+
let c = S(t.x, n), l = S(t.y, n), u = S(t.width, n), d = S(t.height, n);
|
|
22368
22366
|
if (d === 0 && t.textBody?.verticalAnchor === "b") {
|
|
22369
|
-
if (t.stroke && (e.save(), J(e, t.stroke, n), e.beginPath(), e.moveTo(
|
|
22370
|
-
let
|
|
22371
|
-
U(e, t.textBody,
|
|
22367
|
+
if (t.stroke && (e.save(), J(e, t.stroke, n), e.beginPath(), e.moveTo(c, l), e.lineTo(c + u, l), e.stroke(), e.restore()), t.textBody) {
|
|
22368
|
+
let a = t.defaultTextColor ? C(t.defaultTextColor) : null;
|
|
22369
|
+
U(e, t.textBody, c, l, u, d, n, a, t.rotation, t.flipH, t.flipV, r, i, o, s);
|
|
22372
22370
|
}
|
|
22373
22371
|
return;
|
|
22374
22372
|
}
|
|
22375
|
-
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(
|
|
22376
|
-
let f = t.geometry.toLowerCase(), p = T(t.fill, e,
|
|
22373
|
+
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(c + u / 2, l + d / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(c + u / 2), -(l + d / 2)));
|
|
22374
|
+
let f = t.geometry.toLowerCase(), p = T(t.fill, e, c, l, u, d);
|
|
22377
22375
|
I(e, t.shadow ?? null, n), t.shadow || L(e, t.glow ?? null, n);
|
|
22378
22376
|
let m = new Set([
|
|
22379
22377
|
"line",
|
|
@@ -22394,7 +22392,7 @@ function B(e, t, n, r = "#000000", i, a = {
|
|
|
22394
22392
|
]), g = t.stroke ? () => {
|
|
22395
22393
|
J(e, t.stroke, n), e.stroke();
|
|
22396
22394
|
} : null;
|
|
22397
|
-
if (!t.custGeom && f !== "arc" && _(f) ? v(e, f,
|
|
22395
|
+
if (!t.custGeom && f !== "arc" && _(f) ? v(e, f, c, l, u, d, [
|
|
22398
22396
|
t.adj,
|
|
22399
22397
|
t.adj2,
|
|
22400
22398
|
t.adj3,
|
|
@@ -22403,8 +22401,8 @@ function B(e, t, n, r = "#000000", i, a = {
|
|
|
22403
22401
|
t.adj6,
|
|
22404
22402
|
t.adj7,
|
|
22405
22403
|
t.adj8
|
|
22406
|
-
], p, g, () => R(e)) : (e.beginPath(), t.custGeom && t.custGeom.length > 0 ? V(e, t.custGeom,
|
|
22407
|
-
let r = y(f,
|
|
22404
|
+
], p, g, () => R(e)) : (e.beginPath(), t.custGeom && t.custGeom.length > 0 ? V(e, t.custGeom, c, l, u, d) : a(e, f, c, l, u, d, t.adj, t.adj2, t.adj3, t.adj4), p && f !== "arc" && (e.fillStyle = p, f === "donut" || f === "smileyface" || f === "frame" ? e.fill("evenodd") : e.fill(), R(e)), g && g()), t.stroke && m.has(f)) {
|
|
22405
|
+
let r = y(f, c, l, u, d, [
|
|
22408
22406
|
t.adj,
|
|
22409
22407
|
t.adj2,
|
|
22410
22408
|
t.adj3,
|
|
@@ -22419,29 +22417,29 @@ function B(e, t, n, r = "#000000", i, a = {
|
|
|
22419
22417
|
i && (f === "line" || f === "straightconnector1") && re(e, r.start, r.end, t.stroke, i, n), t.stroke.tailEnd && q(e, r.end.x, r.end.y, r.end.angle, t.stroke.tailEnd, t.stroke, n), t.stroke.headEnd && q(e, r.start.x, r.start.y, r.start.angle, t.stroke.headEnd, t.stroke, n);
|
|
22420
22418
|
}
|
|
22421
22419
|
} else if (t.stroke && h.has(f)) {
|
|
22422
|
-
let r = (t.adj2 ?? -8333) / 1e5, i = (t.adj ?? 18750) / 1e5, a = (t.adj4 ?? -38333) / 1e5, o = (t.adj3 ?? 112500) / 1e5,
|
|
22423
|
-
t.stroke.tailEnd && q(e, p, m, h, t.stroke.tailEnd, t.stroke, n), t.stroke.headEnd && q(e,
|
|
22420
|
+
let r = (t.adj2 ?? -8333) / 1e5, i = (t.adj ?? 18750) / 1e5, a = (t.adj4 ?? -38333) / 1e5, o = (t.adj3 ?? 112500) / 1e5, s = c + r * u, f = l + i * d, p = c + a * u, m = l + o * d, h = Math.atan2(m - f, p - s), g = h + Math.PI;
|
|
22421
|
+
t.stroke.tailEnd && q(e, p, m, h, t.stroke.tailEnd, t.stroke, n), t.stroke.headEnd && q(e, s, f, g, t.stroke.headEnd, t.stroke, n);
|
|
22424
22422
|
}
|
|
22425
22423
|
if (t.textBody) {
|
|
22426
|
-
let
|
|
22424
|
+
let a = t.defaultTextColor ? C(t.defaultTextColor) : null;
|
|
22427
22425
|
if (e.save(), t.flipH || t.flipV) {
|
|
22428
|
-
let n =
|
|
22426
|
+
let n = c + u / 2, r = l + d / 2;
|
|
22429
22427
|
e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
|
|
22430
22428
|
}
|
|
22431
|
-
let p =
|
|
22429
|
+
let p = c, m = l, h = u, g = d;
|
|
22432
22430
|
if (t.textRect) p = S(t.textRect.x, n), m = S(t.textRect.y, n), h = S(t.textRect.width, n), g = S(t.textRect.height, n);
|
|
22433
22431
|
else if (f === "ellipse") {
|
|
22434
22432
|
let e = u * (1 - 1 / Math.SQRT2) / 2, t = d * (1 - 1 / Math.SQRT2) / 2;
|
|
22435
|
-
p =
|
|
22433
|
+
p = c + e, m = l + t, h = u / Math.SQRT2, g = d / Math.SQRT2;
|
|
22436
22434
|
} else {
|
|
22437
|
-
let e = z(f,
|
|
22435
|
+
let e = z(f, c, l, u, d, t.adj, t.adj2);
|
|
22438
22436
|
e && (p = e.tx, m = e.ty, h = e.tw, g = e.th);
|
|
22439
22437
|
}
|
|
22440
|
-
U(e, t.textBody, p, m, h, g, n,
|
|
22438
|
+
U(e, t.textBody, p, m, h, g, n, a, t.rotation, !1, !1, r, i, o, s), e.restore();
|
|
22441
22439
|
}
|
|
22442
22440
|
e.restore();
|
|
22443
22441
|
}
|
|
22444
|
-
var V =
|
|
22442
|
+
var V = c;
|
|
22445
22443
|
function ee(e, t) {
|
|
22446
22444
|
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = H(e).toLowerCase(), o = H(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
|
|
22447
22445
|
switch (t) {
|
|
@@ -22803,7 +22801,7 @@ function q(e, t, n, r, i, a, o) {
|
|
|
22803
22801
|
e.restore();
|
|
22804
22802
|
}
|
|
22805
22803
|
function J(e, t, n) {
|
|
22806
|
-
|
|
22804
|
+
s(e, t, n);
|
|
22807
22805
|
}
|
|
22808
22806
|
function Y(e, t, n, r, i = {
|
|
22809
22807
|
themeMajorFont: null,
|
|
@@ -22828,8 +22826,8 @@ function Y(e, t, n, r, i = {
|
|
|
22828
22826
|
l += d;
|
|
22829
22827
|
}
|
|
22830
22828
|
}
|
|
22831
|
-
async function X(e, t,
|
|
22832
|
-
let s = a.width ?? ((e instanceof HTMLCanvasElement ? e.offsetWidth : 0) || 960), c = s /
|
|
22829
|
+
async function X(e, t, r, i, a = {}, o) {
|
|
22830
|
+
let s = a.width ?? ((e instanceof HTMLCanvasElement ? e.offsetWidth : 0) || 960), c = s / r, l = Math.round(s), u = Math.round(i * c), d = a.dpr ?? (typeof window < "u" && window.devicePixelRatio || 1);
|
|
22833
22831
|
e.width = l * d, e.height = u * d, typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement && (e.style.width = `${l}px`, e.style.display || (e.style.display = "block"));
|
|
22834
22832
|
let f = e.getContext("2d");
|
|
22835
22833
|
if (!f) throw Error("Could not get 2D context");
|
|
@@ -22847,7 +22845,7 @@ async function X(e, t, n, i, a = {}, o) {
|
|
|
22847
22845
|
else if (e.type === "media") await ne(f, e, c, a.fetchMedia, a.skipMediaControls);
|
|
22848
22846
|
else if (e.type === "chart") {
|
|
22849
22847
|
let t = 12700 * c;
|
|
22850
|
-
|
|
22848
|
+
n(f, {
|
|
22851
22849
|
chartType: e.chartType,
|
|
22852
22850
|
title: e.title,
|
|
22853
22851
|
categories: e.categories,
|
|
@@ -23144,7 +23142,7 @@ var Te = "data:application/wasm;base64,AGFzbQEAAAAB6QIvYAJ/fwF/YAJ/fwBgA39/fwBgA
|
|
|
23144
23142
|
poppins: { url: "https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,700;1,400;1,700&display=swap" },
|
|
23145
23143
|
raleway: { url: "https://fonts.googleapis.com/css2?family=Raleway:ital,wght@0,400;0,700;1,400;1,700&display=swap" },
|
|
23146
23144
|
"playfair display": { url: "https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400;1,700&display=swap" }
|
|
23147
|
-
}, De = class
|
|
23145
|
+
}, De = class e {
|
|
23148
23146
|
_worker;
|
|
23149
23147
|
_presentation = null;
|
|
23150
23148
|
_pendingParseCallbacks = /* @__PURE__ */ new Map();
|
|
@@ -23188,14 +23186,14 @@ var Te = "data:application/wasm;base64,AGFzbQEAAAAB6QIvYAJ/fwF/YAJ/fwBgA39/fwBgA
|
|
|
23188
23186
|
}
|
|
23189
23187
|
};
|
|
23190
23188
|
}
|
|
23191
|
-
static async load(
|
|
23192
|
-
let
|
|
23193
|
-
if (typeof
|
|
23194
|
-
let e = await fetch(
|
|
23189
|
+
static async load(t, n = {}) {
|
|
23190
|
+
let r = new e(), i;
|
|
23191
|
+
if (typeof t == "string") {
|
|
23192
|
+
let e = await fetch(t);
|
|
23195
23193
|
if (!e.ok) throw Error(`Failed to fetch: ${e.status} ${e.statusText}`);
|
|
23196
|
-
|
|
23197
|
-
} else
|
|
23198
|
-
return await
|
|
23194
|
+
i = await e.arrayBuffer();
|
|
23195
|
+
} else i = t;
|
|
23196
|
+
return await r._parse(i, n.maxZipEntryBytes), n.useGoogleFonts && await o([r._presentation.majorFont, r._presentation.minorFont], Ee), r;
|
|
23199
23197
|
}
|
|
23200
23198
|
_waitForWorker() {
|
|
23201
23199
|
return this._workerReady ? Promise.resolve() : new Promise((e) => this._workerReadyCallbacks.push(e));
|
|
@@ -23375,10 +23373,10 @@ var Te = "data:application/wasm;base64,AGFzbQEAAAAB6QIvYAJ/fwF/YAJ/fwBgA39/fwBgA
|
|
|
23375
23373
|
destroy() {
|
|
23376
23374
|
this.handle?.dispose(), this.handle = null, this.engine?.destroy(), this.wrapper.remove();
|
|
23377
23375
|
}
|
|
23378
|
-
}, ke = /* @__PURE__ */
|
|
23376
|
+
}, ke = /* @__PURE__ */ i({
|
|
23379
23377
|
PptxPresentation: () => De,
|
|
23380
23378
|
PptxViewer: () => Oe,
|
|
23381
|
-
autoResize: () =>
|
|
23379
|
+
autoResize: () => t,
|
|
23382
23380
|
renderSlide: () => X
|
|
23383
23381
|
});
|
|
23384
23382
|
//#endregion
|