@silurus/ooxml 0.82.1 → 0.83.1
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 +74 -5
- package/dist/assets/render-worker-4GSYWsM3.js +11 -0
- package/dist/assets/{render-worker-Cy-QsDge.js → render-worker-DwFpY197.js} +4 -4
- package/dist/{canvas-viewer-mechanics-CS_qbr6T.js → canvas-viewer-mechanics-h07vpVOQ.js} +42 -2
- package/dist/{comment-ui-runtime-C1RV_3iu.js → comment-ui-runtime-BelHJt73.js} +2 -2
- package/dist/{comment-ui-runtime-DgCZpPR0.js → comment-ui-runtime-DD5a3x3k.js} +2 -2
- package/dist/{comments-Cf9W7r3M.js → comments-AAaNnQTi.js} +7 -2
- package/dist/{document-pull-client-B1WOjA0z.js → document-pull-client-DSx36ZsB.js} +4519 -3952
- package/dist/docx-BF-WKW73.js +2784 -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-CA-Q09yW.js +3010 -0
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-BC8p7vZQ.js → render-DtbFbO5c.js} +1 -1
- package/dist/{render-worker-host-BNnXCtAu.js → render-worker-host-D1jcACJV.js} +1 -1
- package/dist/{render-worker-host-DhnkTyjj.js → render-worker-host-DCLyw6UR.js} +1 -1
- package/dist/{resource-measurement-CsW4_eYt.js → resource-measurement-DuiFWzam.js} +3 -3
- package/dist/{session-Da7LEQUB.js → session-CxT-t0BX.js} +107 -94
- package/dist/{slide-pull-client-Bg9DusLX.js → slide-pull-client-B9rcJdO4.js} +1190 -937
- package/dist/types/docx.d.ts +103 -8
- package/dist/types/index.d.ts +195 -13
- package/dist/types/node.d.ts +2 -2
- package/dist/types/pptx.d.ts +100 -5
- package/dist/types/xlsx.d.ts +2 -2
- package/dist/{worksheet-pull-client-CYtwXP5D.js → worksheet-pull-client-DyFsDF4A.js} +32 -32
- package/dist/{xlsx-DMWeXT-c.js → xlsx-BibrHQ52.js} +476 -476
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +3 -1
- package/dist/assets/render-worker-aHayzR7v.js +0 -11
- package/dist/docx-HoZXZUPA.js +0 -2162
- package/dist/dom-interaction-boundary-C8F6HO5x.js +0 -119
- package/dist/line-distribute-iXsUCIH-.js +0 -1003
- package/dist/pptx-DEUP4Yq5.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,6 +1,6 @@
|
|
|
1
1
|
import { i as e } from "./units-BzZ0gAxs.js";
|
|
2
|
-
import { t } from "./highlight-rect-
|
|
3
|
-
import { t as n } from "./comment-occurrence-
|
|
2
|
+
import { t } from "./highlight-rect-Hes0z_Mj.js";
|
|
3
|
+
import { t as n } from "./comment-occurrence-X54si2ob.js";
|
|
4
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
|
|
@@ -1,6 +1,6 @@
|
|
|
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-
|
|
3
|
+
import { n } from "./comments-AAaNnQTi.js";
|
|
4
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
|
|
@@ -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]);
|