@silurus/ooxml 0.82.0 → 0.83.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 +72 -3
- package/dist/assets/{render-worker-7-Zr7fSw.js → render-worker-Bu31cf1J.js} +4 -4
- package/dist/assets/render-worker-DuztdEcX.js +11 -0
- package/dist/{canvas-viewer-mechanics-CS_qbr6T.js → canvas-viewer-mechanics-h07vpVOQ.js} +42 -2
- package/dist/{comment-ui-runtime-BAe30Ct9.js → comment-ui-runtime-BelHJt73.js} +3 -3
- package/dist/{comment-ui-runtime-BUCj4hWn.js → comment-ui-runtime-DD5a3x3k.js} +3 -3
- package/dist/comment-ui-runtime-DTGN3Vyy.js +2 -0
- package/dist/{comments-Cf9W7r3M.js → comments-AAaNnQTi.js} +7 -2
- package/dist/{document-pull-client-BCgmytqI.js → document-pull-client-BAhqoTmm.js} +4509 -3953
- package/dist/docx-Dg73PGgC.js +2707 -0
- package/dist/docx.mjs +6 -6
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/dom-interaction-boundary-CepOlXt6.js +217 -0
- package/dist/index.mjs +4 -4
- package/dist/line-distribute-D7A_wnJg.js +1003 -0
- package/dist/{line-metrics-B3syvDn2.js → line-metrics-Bpn7OeZD.js} +616 -616
- package/dist/node.mjs +308 -308
- package/dist/pptx-BcUCETmQ.js +2990 -0
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{read-only-comment-margin-Dn2y55W6.js → read-only-comment-margin-DrUX-YrP.js} +1 -1
- package/dist/{render-CenWM4g1.js → render-CL-7V3E8.js} +1 -1
- package/dist/{render-worker-host-BNENN3qP.js → render-worker-host-DDZo0feh.js} +1 -1
- package/dist/{render-worker-host-BmH3kGSj.js → render-worker-host-FJ19-fUI.js} +1 -1
- package/dist/{resource-measurement-CsW4_eYt.js → resource-measurement-DuiFWzam.js} +3 -3
- package/dist/{session-Cky_swUj.js → session-BjydZEDF.js} +107 -94
- package/dist/{slide-pull-client-CqTVFb3W.js → slide-pull-client-CwvvncPA.js} +1199 -970
- package/dist/types/docx.d.ts +99 -7
- package/dist/types/index.d.ts +189 -12
- package/dist/types/node.d.ts +385 -379
- package/dist/types/pptx.d.ts +96 -5
- package/dist/types/xlsx.d.ts +4 -2
- package/dist/{worksheet-pull-client-CYtwXP5D.js → worksheet-pull-client-DyFsDF4A.js} +32 -32
- package/dist/{xlsx-DlV37-0j.js → xlsx-BibrHQ52.js} +477 -477
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +4 -1
- package/dist/assets/render-worker-B5gsW6b5.js +0 -11
- package/dist/comment-ui-runtime-F4a3te6p.js +0 -2
- package/dist/docx-wokGKYfi.js +0 -2162
- package/dist/dom-interaction-boundary-C8F6HO5x.js +0 -119
- package/dist/line-distribute-iXsUCIH-.js +0 -1003
- package/dist/pptx-DU8L8I2T.js +0 -2432
- /package/dist/{comment-occurrence-C34fWs_F.js → comment-occurrence-X54si2ob.js} +0 -0
- /package/dist/{highlight-rect-MaCt0om0.js → highlight-rect-Hes0z_Mj.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Zt as e } from "./line-metrics-Bpn7OeZD.js";
|
|
2
2
|
//#region packages/core/src/errors/cfb-sniff.ts
|
|
3
3
|
var t = [
|
|
4
4
|
208,
|
|
@@ -1088,18 +1088,58 @@ var $e = class {
|
|
|
1088
1088
|
}
|
|
1089
1089
|
return !0;
|
|
1090
1090
|
}
|
|
1091
|
+
commitBitmapTo2d(e, t, n = {}) {
|
|
1092
|
+
if (!this.isCurrent(e)) return t.close(), !1;
|
|
1093
|
+
this.canvas.width !== t.width && (this.canvas.width = t.width), this.canvas.height !== t.height && (this.canvas.height = t.height), n.cssWidth !== void 0 && (this.canvas.style.width = `${n.cssWidth}px`), n.cssHeight !== void 0 && (this.canvas.style.height = `${n.cssHeight}px`);
|
|
1094
|
+
let r = this.canvas.getContext("2d");
|
|
1095
|
+
if (!r) throw t.close(), Error("2D context not available");
|
|
1096
|
+
try {
|
|
1097
|
+
r.drawImage(t, 0, 0);
|
|
1098
|
+
} finally {
|
|
1099
|
+
t.close();
|
|
1100
|
+
}
|
|
1101
|
+
return !0;
|
|
1102
|
+
}
|
|
1091
1103
|
destroy() {
|
|
1092
1104
|
this.destroyed || (this.destroyed = !0, this.generation++);
|
|
1093
1105
|
}
|
|
1094
1106
|
}, tt = class {
|
|
1095
1107
|
closed = !1;
|
|
1108
|
+
handled = /* @__PURE__ */ new WeakSet();
|
|
1109
|
+
backgroundLifecycleOwners = 0;
|
|
1096
1110
|
constructor(e, t) {
|
|
1097
1111
|
this.viewerName = e, this.onError = t;
|
|
1098
1112
|
}
|
|
1099
1113
|
report(e) {
|
|
1100
1114
|
if (this.closed) return;
|
|
1101
1115
|
let t = e instanceof Error ? e : Error(String(e));
|
|
1102
|
-
this.onError ? this.onError(t) : console.error(`[ooxml] ${this.viewerName} render failed:`, t);
|
|
1116
|
+
this.handled.has(t) || (this.handled.add(t), this.onError ? this.onError(t) : console.error(`[ooxml] ${this.viewerName} render failed:`, t));
|
|
1117
|
+
}
|
|
1118
|
+
markHandled(e) {
|
|
1119
|
+
this.closed || !(e instanceof Error) || this.handled.add(e);
|
|
1120
|
+
}
|
|
1121
|
+
async ownAwaitable(e) {
|
|
1122
|
+
try {
|
|
1123
|
+
return await e();
|
|
1124
|
+
} catch (e) {
|
|
1125
|
+
throw this.markHandled(e), e;
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
async ownBackgroundLifecycle(e) {
|
|
1129
|
+
this.backgroundLifecycleOwners++;
|
|
1130
|
+
try {
|
|
1131
|
+
return await this.ownAwaitable(e);
|
|
1132
|
+
} finally {
|
|
1133
|
+
this.backgroundLifecycleOwners--;
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
reportBackground(e, t = !1) {
|
|
1137
|
+
let n = e instanceof Error ? e : Error(String(e));
|
|
1138
|
+
if (t || this.backgroundLifecycleOwners > 0) {
|
|
1139
|
+
this.markHandled(n);
|
|
1140
|
+
return;
|
|
1141
|
+
}
|
|
1142
|
+
this.report(n);
|
|
1103
1143
|
}
|
|
1104
1144
|
close() {
|
|
1105
1145
|
this.closed = !0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as e } from "./units-BzZ0gAxs.js";
|
|
2
|
-
import { t } from "./highlight-rect-
|
|
3
|
-
import { t as n } from "./comment-occurrence-
|
|
4
|
-
import { i as r, n as i, o as a, r as o, t as s } from "./read-only-comment-margin-
|
|
2
|
+
import { t } from "./highlight-rect-Hes0z_Mj.js";
|
|
3
|
+
import { t as n } from "./comment-occurrence-X54si2ob.js";
|
|
4
|
+
import { i as r, n as i, o as a, r as o, t as s } from "./read-only-comment-margin-DrUX-YrP.js";
|
|
5
5
|
import { i as c, n as l, r as u, t as d } from "./read-only-comment-decoration-DcFevX_Q.js";
|
|
6
6
|
//#region packages/pptx/src/comment-margin.ts
|
|
7
7
|
function f(e, t, n) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as e } from "./highlight-rect-
|
|
1
|
+
import { t as e } from "./highlight-rect-Hes0z_Mj.js";
|
|
2
2
|
import { o as t } from "./source-key-BklvnEyQ.js";
|
|
3
|
-
import { n } from "./comments-
|
|
4
|
-
import { i as r, n as i, o as a, r as o, s, t as c } from "./read-only-comment-margin-
|
|
3
|
+
import { n } from "./comments-AAaNnQTi.js";
|
|
4
|
+
import { i as r, n as i, o as a, r as o, s, t as c } from "./read-only-comment-margin-DrUX-YrP.js";
|
|
5
5
|
import { i as l, n as u, r as d, t as f } from "./read-only-comment-decoration-DcFevX_Q.js";
|
|
6
6
|
//#region packages/docx/src/comment-margin.ts
|
|
7
7
|
function p(e, r) {
|
|
@@ -137,8 +137,13 @@ function d(e, t, n = /* @__PURE__ */ new Map()) {
|
|
|
137
137
|
}
|
|
138
138
|
return [...i.values()].flatMap((e) => u(e, r, n));
|
|
139
139
|
}
|
|
140
|
-
function f(
|
|
141
|
-
|
|
140
|
+
function f(t, n, r = /* @__PURE__ */ new Map(), i = {}) {
|
|
141
|
+
if ((t?.length ?? 0) === 0) return [];
|
|
142
|
+
let a = d(t ?? [], n, r), o = i.completedSourceKeys;
|
|
143
|
+
return o === void 0 ? a : a.filter((t) => {
|
|
144
|
+
let n = r.get(e(t.source)) ?? /* @__PURE__ */ new Set(), i = t.startRunIndex < t.endRunIndex ? [...n].some((e) => e >= t.startRunIndex && e < t.endRunIndex) : n.has(t.reference.affinity === "following" ? t.startRunIndex : t.startRunIndex - 1), a = r.get(e(t.reference.source))?.has(t.reference.affinity === "following" ? t.reference.runIndex : t.reference.runIndex - 1) === !0;
|
|
145
|
+
return i || a || o.has(e(t.source)) || o.has(e(t.reference.source));
|
|
146
|
+
});
|
|
142
147
|
}
|
|
143
148
|
function p(e, t) {
|
|
144
149
|
return e !== void 0 && e.story === t.story && e.storyInstance === t.storyInstance && e.path.length === t.path.length && e.path.every((e, n) => e === t.path[n]);
|