@silurus/ooxml 0.85.1 → 0.85.3
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 +3 -2
- package/dist/assets/render-worker-D1O73gYW.js +10 -0
- package/dist/assets/{render-worker-BRKOyWVH.js → render-worker-DHP0rgcW.js} +16 -16
- package/dist/assets/render-worker-V2wWYA4O.js +11 -0
- package/dist/{canvas-viewer-mechanics-CfRzOhz5.js → canvas-viewer-mechanics-CDNMJ-Yz.js} +1 -1
- package/dist/{document-pull-client-BkHHIdR4.js → document-pull-client-F3ox_VXK.js} +3505 -3494
- package/dist/{docx-_uelcAui.js → docx-BYvm3TWw.js} +21 -38
- package/dist/docx.mjs +5 -5
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{dom-interaction-boundary-CMDDgICk.js → dom-interaction-boundary-CDGegIB5.js} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/line-distribute-BsV4MVZ2.js +1023 -0
- package/dist/{line-metrics-u87yCAfV.js → line-metrics-BGtFM-ec.js} +650 -607
- package/dist/node.mjs +30 -30
- package/dist/{pptx-WpBbS0mq.js → pptx-BqpVTP8p.js} +27 -24
- package/dist/pptx.mjs +6 -6
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{raster-target-whZhvVMt.js → raster-target-ojDdQizC.js} +11 -7
- package/dist/{render-DrAAZWwH.js → render-DeZpRCfx.js} +1 -1
- package/dist/{render-worker-host-XDMsyVsv.js → render-worker-host-BKtXmlEF.js} +1 -1
- package/dist/{render-worker-host-CBVe8aeD.js → render-worker-host-CBcQXsR5.js} +1 -1
- package/dist/{render-worker-host-CHlwYJdK.js → render-worker-host-CNKQ76tu.js} +1 -1
- package/dist/{resource-measurement-6uR3Huao.js → resource-measurement-D41R-0Bl.js} +4 -4
- package/dist/{session-DoPwA4gv.js → session-n2p5_jxV.js} +6 -6
- package/dist/{slide-pull-client-8i8C4VyD.js → slide-pull-client-Dwek7xW8.js} +462 -444
- package/dist/tiff.mjs +1 -1
- package/dist/types/chart-ex.d.ts +2 -2
- package/dist/types/docx.d.ts +8 -10
- package/dist/types/index.d.ts +12 -14
- package/dist/types/node.d.ts +5 -5
- package/dist/types/pptx.d.ts +8 -7
- package/dist/types/region-map.d.ts +2 -2
- package/dist/types/three-d.d.ts +2 -2
- package/dist/types/xlsx.d.ts +8 -7
- package/dist/{worksheet-pull-client-Btydoxto.js → worksheet-pull-client-C9sC36Vu.js} +20 -20
- package/dist/{xlsx-Bd16V4Xx.js → xlsx-DSU6pV1O.js} +1214 -1208
- package/dist/xlsx.mjs +6 -6
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-CtLMFj9r.js +0 -10
- package/dist/assets/render-worker-NZPOUOTU.js +0 -11
- package/dist/line-distribute-CiKeWjBF.js +0 -1023
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { t as e } from "./chunk-DmhlhrBa.js";
|
|
2
|
-
import { B as t, R as n, W as r,
|
|
3
|
-
import { C as p, D as m, E as h, S as g, T as _, _ as v, a as y, b, c as x, d as ee, f as te, g as ne, h as re, i as S, l as C, m as ie, n as ae, o as oe, p as se, r as ce, s as le, t as ue, u as de, v as fe, w as pe, x as me, y as he } from "./canvas-viewer-mechanics-
|
|
2
|
+
import { B as t, R as n, W as r, Zt as i, a, cn as o, et as s, pt as c, sn as l, ut as u, vt as d, z as f } from "./line-metrics-BGtFM-ec.js";
|
|
3
|
+
import { C as p, D as m, E as h, S as g, T as _, _ as v, a as y, b, c as x, d as ee, f as te, g as ne, h as re, i as S, l as C, m as ie, n as ae, o as oe, p as se, r as ce, s as le, t as ue, u as de, v as fe, w as pe, x as me, y as he } from "./canvas-viewer-mechanics-CDNMJ-Yz.js";
|
|
4
4
|
import { a as ge, i as _e, t as ve } from "./bounded-raw-part-cache-C6ro6Ezf.js";
|
|
5
|
-
import { c as ye, i as be, l as xe, n as Se, o as w, r as Ce, s as we, t as Te } from "./dom-interaction-boundary-
|
|
6
|
-
import { A as Ee, C as T, D as E, E as De, O as D, S as Oe, T as O, _ as ke, a as Ae, b as je, c as Me, d as Ne, f as Pe, g as Fe, h as Ie, j as Le, k as Re, l as ze, m as Be, n as k, o as Ve, p as He, s as Ue, t as A, v as We, w as Ge, x as Ke, y as qe } from "./document-pull-client-
|
|
5
|
+
import { c as ye, i as be, l as xe, n as Se, o as w, r as Ce, s as we, t as Te } from "./dom-interaction-boundary-CDGegIB5.js";
|
|
6
|
+
import { A as Ee, C as T, D as E, E as De, O as D, S as Oe, T as O, _ as ke, a as Ae, b as je, c as Me, d as Ne, f as Pe, g as Fe, h as Ie, j as Le, k as Re, l as ze, m as Be, n as k, o as Ve, p as He, s as Ue, t as A, v as We, w as Ge, x as Ke, y as qe } from "./document-pull-client-F3ox_VXK.js";
|
|
7
7
|
import { l as Je, s as Ye } from "./pixel-budget-Dgjw269h.js";
|
|
8
8
|
import { a as j } from "./units-EJdC96r6.js";
|
|
9
|
-
import { i as Xe, s as Ze } from "./raster-target-
|
|
9
|
+
import { i as Xe, s as Ze } from "./raster-target-ojDdQizC.js";
|
|
10
10
|
import { n as Qe } from "./renderer-module-contract-Cu-GKuPd.js";
|
|
11
11
|
import { n as $e, t as M } from "./highlight-rect-DBcYVJDv.js";
|
|
12
12
|
import { o as N } from "./source-key-BkBB3X82.js";
|
|
@@ -553,7 +553,7 @@ var J = class e {
|
|
|
553
553
|
t = await e.arrayBuffer();
|
|
554
554
|
} else t = r;
|
|
555
555
|
t = m(await h(t, i.password)), c.setSourceBytes(t.byteLength), c.checkpoint("container ready");
|
|
556
|
-
let n = s === "worker" ? (await import("./render-worker-host-
|
|
556
|
+
let n = s === "worker" ? (await import("./render-worker-host-CBcQXsR5.js")).createRenderWorker() : new at(), l = s === "worker" ? Qe(i) : void 0, u = s === "worker" && !!i.progressiveLayout, d;
|
|
557
557
|
try {
|
|
558
558
|
d = new e(n, s, o, i.wasmUrl), d._metrics = c;
|
|
559
559
|
let r = E(d), f = O(i.currentDate, r.defaultCurrentDateMs, i.showTrackedChanges === !0);
|
|
@@ -1021,7 +1021,7 @@ var J = class e {
|
|
|
1021
1021
|
async renderPageToBitmap(e, t = {}) {
|
|
1022
1022
|
let { onTextRun: n, ...r } = t, i = {
|
|
1023
1023
|
...this._withActiveView(r),
|
|
1024
|
-
dpr: r.dpr ??
|
|
1024
|
+
dpr: r.dpr ?? s()
|
|
1025
1025
|
};
|
|
1026
1026
|
if (this._mode === "worker") {
|
|
1027
1027
|
let t = await this._bridge.request((t) => ({
|
|
@@ -1810,7 +1810,6 @@ var cn = class e {
|
|
|
1810
1810
|
_lastReportedLayoutComplete = null;
|
|
1811
1811
|
_layoutUnsubscribe = null;
|
|
1812
1812
|
_presentedPageCount = 0;
|
|
1813
|
-
_pendingLayoutPublication = null;
|
|
1814
1813
|
_scrollListener = null;
|
|
1815
1814
|
_selectionChangeListener = null;
|
|
1816
1815
|
_selectionContextKey = "null";
|
|
@@ -1942,7 +1941,7 @@ var cn = class e {
|
|
|
1942
1941
|
});
|
|
1943
1942
|
}
|
|
1944
1943
|
_bindLayoutDocument(e) {
|
|
1945
|
-
this._unbindLayoutDocument(), this._layoutViewPublicationGeneration = 0, this._presentedPageCount = e.pageCount
|
|
1944
|
+
this._unbindLayoutDocument(), this._layoutViewPublicationGeneration = 0, this._presentedPageCount = e.pageCount;
|
|
1946
1945
|
let t = zt(e, (t) => this._onLayoutViewPublication(e, t), (e) => this._reportRenderError(e)), n = !0, r = Ft(e, () => ({
|
|
1947
1946
|
pageCount: e.pageCount,
|
|
1948
1947
|
exact: e.layoutComplete,
|
|
@@ -1959,7 +1958,7 @@ var cn = class e {
|
|
|
1959
1958
|
};
|
|
1960
1959
|
}
|
|
1961
1960
|
_unbindLayoutDocument() {
|
|
1962
|
-
this._layoutUnsubscribe?.(), this._layoutUnsubscribe = null, this._presentedPageCount = 0
|
|
1961
|
+
this._layoutUnsubscribe?.(), this._layoutUnsubscribe = null, this._presentedPageCount = 0;
|
|
1963
1962
|
}
|
|
1964
1963
|
_onLayoutPublication(e, t) {
|
|
1965
1964
|
if (!(this._destroyed || e !== this._doc)) {
|
|
@@ -1967,19 +1966,11 @@ var cn = class e {
|
|
|
1967
1966
|
this._errorRouter.reportBackground(t.error, this._opts.onLayoutComplete !== void 0);
|
|
1968
1967
|
return;
|
|
1969
1968
|
}
|
|
1970
|
-
|
|
1971
|
-
if (this._pendingLayoutPublication = t, this._lastRange && this._emitVisiblePageChange(this._lastRange), this._presentedPageCount === 0 || t.pageCount < this._presentedPageCount) {
|
|
1972
|
-
this._pendingLayoutPublication = null, this._applyLayoutPublication(t);
|
|
1973
|
-
return;
|
|
1974
|
-
}
|
|
1975
|
-
this._revealPendingLayoutAtPresentedTail();
|
|
1976
|
-
return;
|
|
1977
|
-
}
|
|
1978
|
-
this._pendingLayoutPublication = null, this._applyLayoutPublication(t);
|
|
1969
|
+
this._find.invalidate(), this._refreshCommentSurface(), this._applyLayoutPublication(t);
|
|
1979
1970
|
}
|
|
1980
1971
|
}
|
|
1981
1972
|
_onLayoutViewPublication(e, t) {
|
|
1982
|
-
this._destroyed || e !== this._doc || t.generation <= this._layoutViewPublicationGeneration || (this._layoutViewPublicationGeneration = t.generation, t.requester !== this && (this._layoutViewGeneration++, this._showTrackedChanges = t.view.showTrackedChanges, this._currentDate = t.view.currentDate, this._find.invalidate(), this.
|
|
1973
|
+
this._destroyed || e !== this._doc || t.generation <= this._layoutViewPublicationGeneration || (this._layoutViewPublicationGeneration = t.generation, t.requester !== this && (this._layoutViewGeneration++, this._showTrackedChanges = t.view.showTrackedChanges, this._currentDate = t.view.currentDate, this._find.invalidate(), this._applyLayoutPublication({
|
|
1983
1974
|
pageCount: e.pageCount,
|
|
1984
1975
|
exact: !0,
|
|
1985
1976
|
complete: e.layoutComplete
|
|
@@ -1996,14 +1987,6 @@ var cn = class e {
|
|
|
1996
1987
|
this._presentedPageCount = e.pageCount, this._renderEpoch++, this.relayout();
|
|
1997
1988
|
for (let [e, n] of t) e >= this._presentedPageCount || this._slots.get(e) !== n || this._refreshSlotAtomically(e, n);
|
|
1998
1989
|
}
|
|
1999
|
-
_revealPendingLayoutAtPresentedTail() {
|
|
2000
|
-
let e = this._pendingLayoutPublication;
|
|
2001
|
-
!e || this._presentedPageCount === 0 || w(this._scrollGeometry, this._scrollHost.scrollTop, this._scrollHost.clientHeight, 0).end < this._presentedPageCount - 1 || (this._pendingLayoutPublication = null, this._applyLayoutPublication(e));
|
|
2002
|
-
}
|
|
2003
|
-
_revealPendingLayoutThroughPage(e) {
|
|
2004
|
-
let t = this._pendingLayoutPublication;
|
|
2005
|
-
!t || e < this._presentedPageCount || (this._pendingLayoutPublication = null, this._applyLayoutPublication(t));
|
|
2006
|
-
}
|
|
2007
1990
|
_pageWidthPx(e) {
|
|
2008
1991
|
return this._doc.pageSize(e).widthPt * j * this._scale;
|
|
2009
1992
|
}
|
|
@@ -2072,7 +2055,7 @@ var cn = class e {
|
|
|
2072
2055
|
}
|
|
2073
2056
|
_relayout(e) {
|
|
2074
2057
|
if (this._doc) {
|
|
2075
|
-
if (this._doc.layoutComplete !== !1 &&
|
|
2058
|
+
if (this._doc.layoutComplete !== !1 && (this._presentedPageCount = this._doc.pageCount), this._scaleEstablished) {
|
|
2076
2059
|
let e = this._baseScale();
|
|
2077
2060
|
if (e > 0 && e !== this._prevBase) {
|
|
2078
2061
|
let t = this._prevBase > 0 ? this._scale / this._prevBase : 1;
|
|
@@ -2141,7 +2124,7 @@ var cn = class e {
|
|
|
2141
2124
|
this._spacer.style.width = `${n + r + e + t}px`, a !== 0 && (this._reviewOriginPx = i, this._scrollHost.style["--ooxml-review-origin-x"] = `${i}px`, this._scrollHost.scrollLeft = o);
|
|
2142
2125
|
}
|
|
2143
2126
|
_onScroll() {
|
|
2144
|
-
!this._doc || !this._scaleEstablished ||
|
|
2127
|
+
!this._doc || !this._scaleEstablished || this._mountVisible(void 0, !1);
|
|
2145
2128
|
}
|
|
2146
2129
|
_mountVisible(e, t = !0) {
|
|
2147
2130
|
if (!this._doc || this._doc.pageCount === 0) return;
|
|
@@ -2313,7 +2296,10 @@ var cn = class e {
|
|
|
2313
2296
|
} finally {
|
|
2314
2297
|
this._bitmapInFlight.delete(e);
|
|
2315
2298
|
let n = this._slots.get(e);
|
|
2316
|
-
!u && n && (n !== t || c !== this._renderEpoch || !a.isCurrent(o)) && !this._bitmapInFlight.has(e) && !this._destroyed
|
|
2299
|
+
if (!u && n && (n !== t || c !== this._renderEpoch || !a.isCurrent(o)) && !this._bitmapInFlight.has(e) && !this._destroyed) {
|
|
2300
|
+
let t = n.dispatcher;
|
|
2301
|
+
await this._renderSlotBitmap(e, n, this._pageWidthPx(e), this._dpr(), this._scale, t, t.begin(), s);
|
|
2302
|
+
}
|
|
2317
2303
|
}
|
|
2318
2304
|
}
|
|
2319
2305
|
setScale(e) {
|
|
@@ -2446,7 +2432,7 @@ var cn = class e {
|
|
|
2446
2432
|
(!n || await K(n, {
|
|
2447
2433
|
showTrackedChanges: e,
|
|
2448
2434
|
currentDate: this._currentDate
|
|
2449
|
-
}, this)) && (this._destroyed || t !== this._layoutViewGeneration || n !== this._doc || (this._showTrackedChanges = e, this._find.invalidate(), this.
|
|
2435
|
+
}, this)) && (this._destroyed || t !== this._layoutViewGeneration || n !== this._doc || (this._showTrackedChanges = e, this._find.invalidate(), this._applyLayoutPublication({
|
|
2450
2436
|
pageCount: n?.pageCount ?? 0,
|
|
2451
2437
|
exact: !0,
|
|
2452
2438
|
complete: n?.layoutComplete !== !1
|
|
@@ -2454,16 +2440,13 @@ var cn = class e {
|
|
|
2454
2440
|
}
|
|
2455
2441
|
scrollToPage(e, t) {
|
|
2456
2442
|
if (!this._doc || this._doc.pageCount === 0 || !this._scaleEstablished) return;
|
|
2457
|
-
let n = Math.max(0, Math.min(e, this._doc.pageCount - 1));
|
|
2458
|
-
this._revealPendingLayoutThroughPage(n);
|
|
2459
|
-
let r = w(this._scrollGeometry, 0, this._scrollHost.clientHeight, this._overscan()), i = r.offsets[n] ?? 0, a = Math.max(0, r.totalHeight - this._scrollHost.clientHeight), o = Math.min(a, Math.max(0, i)), s = this._scrollHost;
|
|
2443
|
+
let n = Math.max(0, Math.min(e, this._doc.pageCount - 1)), r = w(this._scrollGeometry, 0, this._scrollHost.clientHeight, this._overscan()), i = r.offsets[n] ?? 0, a = Math.max(0, r.totalHeight - this._scrollHost.clientHeight), o = Math.min(a, Math.max(0, i)), s = this._scrollHost;
|
|
2460
2444
|
typeof s.scrollTo == "function" ? s.scrollTo({
|
|
2461
2445
|
top: o,
|
|
2462
2446
|
behavior: t?.behavior ?? "auto"
|
|
2463
2447
|
}) : this._scrollHost.scrollTop = o, this._mountVisible();
|
|
2464
2448
|
}
|
|
2465
2449
|
_scrollToPageTarget(e, t, n) {
|
|
2466
|
-
this._revealPendingLayoutThroughPage(e);
|
|
2467
2450
|
let r = w(this._scrollGeometry, 0, this._scrollHost.clientHeight, this._overscan()), i = this._pageWidthPx(e), { left: a } = this._padH(), o = Math.max(a, (this._scrollHost.clientWidth - i) / 2) + this._reviewOriginPx, s = Math.max(0, r.totalHeight - this._scrollHost.clientHeight), c = this._spacer.offsetWidth || Number.parseFloat(this._spacer.style.width) || 0, l = Math.max(0, c - this._scrollHost.clientWidth), u = Math.min(s, Math.max(0, (r.offsets[e] ?? 0) + t.y + t.h / 2 - this._scrollHost.clientHeight / 2)), d = Math.min(l, Math.max(0, o + t.x + t.w / 2 - this._scrollHost.clientWidth / 2)), f = this._scrollHost;
|
|
2468
2451
|
typeof f.scrollTo == "function" ? f.scrollTo({
|
|
2469
2452
|
top: u,
|
|
@@ -2801,8 +2784,8 @@ var un = /* @__PURE__ */ e({
|
|
|
2801
2784
|
DocxScrollViewer: () => cn,
|
|
2802
2785
|
DocxViewer: () => $t,
|
|
2803
2786
|
OoxmlDecodedImageLimitError: () => Ye,
|
|
2804
|
-
OoxmlError: () =>
|
|
2805
|
-
OoxmlResourceLimitError: () =>
|
|
2787
|
+
OoxmlError: () => l,
|
|
2788
|
+
OoxmlResourceLimitError: () => o,
|
|
2806
2789
|
TiffDecodeError: () => Xe,
|
|
2807
2790
|
autoResize: () => _,
|
|
2808
2791
|
buildDocxHighlightLayer: () => Z,
|
package/dist/docx.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as e,
|
|
2
|
-
import { T as r } from "./canvas-viewer-mechanics-
|
|
1
|
+
import { a as e, cn as t, sn as n } from "./line-metrics-BGtFM-ec.js";
|
|
2
|
+
import { T as r } from "./canvas-viewer-mechanics-CDNMJ-Yz.js";
|
|
3
3
|
import { l as i, s as a } from "./pixel-budget-Dgjw269h.js";
|
|
4
|
-
import { i as o, s } from "./raster-target-
|
|
5
|
-
import { a as c, c as l, i as u, l as d, n as f, o as p, r as m, s as h } from "./docx-
|
|
4
|
+
import { i as o, s } from "./raster-target-ojDdQizC.js";
|
|
5
|
+
import { a as c, c as l, i as u, l as d, n as f, o as p, r as m, s as h } from "./docx-BYvm3TWw.js";
|
|
6
6
|
import { n as g, r as _ } from "./comments-Brfxa3hQ.js";
|
|
7
|
-
export { l as DocxDocument, m as DocxScrollViewer, u as DocxViewer, a as OoxmlDecodedImageLimitError,
|
|
7
|
+
export { l as DocxDocument, m as DocxScrollViewer, u as DocxViewer, a as OoxmlDecodedImageLimitError, n as OoxmlError, t as OoxmlResourceLimitError, o as TiffDecodeError, r as autoResize, p as buildDocxHighlightLayer, h as buildDocxTextLayer, i as isOoxmlDecodedImageLimitError, s as isTiffDecodeError, f as noteText, e as openExternalHyperlink, c as readDocxTextSelectionContext, g as resolveCommentAnchorRuns, _ as resolveDocxCommentThreads, d as resolveRevisionAnchorRuns };
|
package/dist/docx_parser_bg.wasm
CHANGED
|
Binary file
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as e } from "./xlsx-
|
|
2
|
-
import { t } from "./pptx-
|
|
3
|
-
import { t as n } from "./docx-
|
|
1
|
+
import { t as e } from "./xlsx-DSU6pV1O.js";
|
|
2
|
+
import { t } from "./pptx-BqpVTP8p.js";
|
|
3
|
+
import { t as n } from "./docx-BYvm3TWw.js";
|
|
4
4
|
export { n as docx, t as pptx, e as xlsx };
|