@bendyline/squisq-formats 2.0.0 → 2.1.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/dist/{chunk-CX3LH47J.js → chunk-74GO3FVS.js} +3 -3
- package/dist/{chunk-4HJ6AK2Q.js → chunk-7ARKUCQT.js} +52 -13
- package/dist/chunk-7ARKUCQT.js.map +1 -0
- package/dist/{chunk-LXYLOOST.js → chunk-DTDF6QDP.js} +3 -3
- package/dist/chunk-DTDF6QDP.js.map +1 -0
- package/dist/{chunk-ZZ7D4DN6.js → chunk-EW54IRRS.js} +39 -9
- package/dist/chunk-EW54IRRS.js.map +1 -0
- package/dist/{chunk-H7T5DXUU.js → chunk-FE6OJV6O.js} +95 -14
- package/dist/chunk-FE6OJV6O.js.map +1 -0
- package/dist/{chunk-XTLQXR4U.js → chunk-KURGXM4I.js} +3 -3
- package/dist/{chunk-2CSZJEAL.js → chunk-NNHKUXKA.js} +292 -70
- package/dist/chunk-NNHKUXKA.js.map +1 -0
- package/dist/{chunk-2PRVLAU3.js → chunk-QFLDYKCR.js} +55 -17
- package/dist/chunk-QFLDYKCR.js.map +1 -0
- package/dist/{chunk-CVNVD7VH.js → chunk-RLU7UFYU.js} +5 -5
- package/dist/{chunk-X4USWOQ2.js → chunk-SC67HYQJ.js} +2 -2
- package/dist/{chunk-HBSCRS5P.js → chunk-UGYF5AZE.js} +3 -3
- package/dist/{chunk-2EFDWKC6.js → chunk-WQSHGBLN.js} +86 -23
- package/dist/chunk-WQSHGBLN.js.map +1 -0
- package/dist/container/index.d.ts +10 -4
- package/dist/container/index.js +9 -4
- package/dist/container/index.js.map +1 -1
- package/dist/docx/index.d.ts +2 -2
- package/dist/docx/index.js +5 -4
- package/dist/{export-Djev9BLU.d.ts → export-D2NkylDT.d.ts} +1 -1
- package/dist/{extract-LNOA7DBK.js → extract-OJ7ZQV6P.js} +5 -5
- package/dist/html/index.js +1 -1
- package/dist/{import-Yivc3kZM.d.ts → import-K8mfc0fz.d.ts} +1 -1
- package/dist/index.d.ts +8 -7
- package/dist/index.js +15 -13
- package/dist/infer/index.d.ts +4 -4
- package/dist/infer/index.js +5 -5
- package/dist/{layouts-7OUUVAGU.js → layouts-5VDIRPIJ.js} +4 -4
- package/dist/{layouts-CZ0bdsNL.d.ts → layouts-BHrgZ5FS.d.ts} +1 -1
- package/dist/ooxml/index.d.ts +4 -4
- package/dist/ooxml/index.js +4 -4
- package/dist/pptx/index.d.ts +5 -5
- package/dist/pptx/index.js +5 -5
- package/dist/{reader-Gof6OrJX.d.ts → reader-B9L8Ucbj.d.ts} +3 -3
- package/dist/registry/index.d.ts +20 -6
- package/dist/registry/index.js +6 -4
- package/dist/{themeReader-DPw4J5Ss.d.ts → themeReader-DJKErl_j.d.ts} +1 -1
- package/dist/xlsx/index.d.ts +4 -4
- package/dist/xlsx/index.js +4 -4
- package/dist/{zipLimits-bGYMS9cI.d.ts → zipLimits-BOKCB7qk.d.ts} +2 -0
- package/package.json +2 -2
- package/src/__tests__/convert.test.ts +143 -1
- package/src/__tests__/docxExport.test.ts +34 -0
- package/src/__tests__/docxImport.test.ts +121 -0
- package/src/__tests__/html.test.ts +4 -0
- package/src/__tests__/ooxml.test.ts +17 -0
- package/src/__tests__/ooxmlCancellation.test.ts +113 -0
- package/src/container/index.ts +17 -3
- package/src/docx/export.ts +113 -5
- package/src/docx/import.ts +324 -69
- package/src/html/htmlTemplate.ts +2 -2
- package/src/index.ts +3 -0
- package/src/infer/index.ts +35 -4
- package/src/ooxml/namespaces.ts +21 -0
- package/src/ooxml/reader.ts +55 -14
- package/src/pptx/layouts.ts +68 -14
- package/src/registry/convert.ts +115 -31
- package/src/registry/defaultFormats.ts +5 -2
- package/src/registry/index.ts +3 -1
- package/src/registry/types.ts +18 -1
- package/src/shared/boundedZipArchive.ts +49 -8
- package/src/shared/zipEntryCount.ts +59 -5
- package/src/shared/zipLimits.ts +10 -0
- package/dist/chunk-2CSZJEAL.js.map +0 -1
- package/dist/chunk-2EFDWKC6.js.map +0 -1
- package/dist/chunk-2PRVLAU3.js.map +0 -1
- package/dist/chunk-4HJ6AK2Q.js.map +0 -1
- package/dist/chunk-H7T5DXUU.js.map +0 -1
- package/dist/chunk-LXYLOOST.js.map +0 -1
- package/dist/chunk-ZZ7D4DN6.js.map +0 -1
- /package/dist/{chunk-CX3LH47J.js.map → chunk-74GO3FVS.js.map} +0 -0
- /package/dist/{chunk-XTLQXR4U.js.map → chunk-KURGXM4I.js.map} +0 -0
- /package/dist/{chunk-CVNVD7VH.js.map → chunk-RLU7UFYU.js.map} +0 -0
- /package/dist/{chunk-X4USWOQ2.js.map → chunk-SC67HYQJ.js.map} +0 -0
- /package/dist/{chunk-HBSCRS5P.js.map → chunk-UGYF5AZE.js.map} +0 -0
- /package/dist/{extract-LNOA7DBK.js.map → extract-OJ7ZQV6P.js.map} +0 -0
- /package/dist/{layouts-7OUUVAGU.js.map → layouts-5VDIRPIJ.js.map} +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseThemeXml,
|
|
3
3
|
readThemePart
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SC67HYQJ.js";
|
|
5
5
|
import {
|
|
6
6
|
findRelByType,
|
|
7
7
|
resolveTarget
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
REL_SLIDE_MASTER,
|
|
14
14
|
getPartRelationships,
|
|
15
15
|
getPartXml
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-7ARKUCQT.js";
|
|
17
17
|
|
|
18
18
|
// src/infer/extract.ts
|
|
19
19
|
var DEFAULT_COLOR_MAP = { bg1: "lt1", tx1: "dk1" };
|
|
@@ -96,4 +96,4 @@ export {
|
|
|
96
96
|
extractPptxTheme,
|
|
97
97
|
extractXlsxTheme
|
|
98
98
|
};
|
|
99
|
-
//# sourceMappingURL=chunk-
|
|
99
|
+
//# sourceMappingURL=chunk-74GO3FVS.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
openBoundedZipArchive
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-FE6OJV6O.js";
|
|
4
4
|
|
|
5
5
|
// src/ooxml/namespaces.ts
|
|
6
6
|
var NS_RELATIONSHIPS = "http://schemas.openxmlformats.org/package/2006/relationships";
|
|
@@ -15,6 +15,8 @@ var REL_SETTINGS = "http://schemas.openxmlformats.org/officeDocument/2006/relati
|
|
|
15
15
|
var REL_HYPERLINK = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink";
|
|
16
16
|
var REL_IMAGE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image";
|
|
17
17
|
var REL_FOOTNOTES = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes";
|
|
18
|
+
var REL_HEADER = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header";
|
|
19
|
+
var REL_FOOTER = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer";
|
|
18
20
|
var REL_THEME = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme";
|
|
19
21
|
var NS_WML = "http://schemas.openxmlformats.org/wordprocessingml/2006/main";
|
|
20
22
|
var NS_PML = "http://schemas.openxmlformats.org/presentationml/2006/main";
|
|
@@ -37,6 +39,8 @@ var CONTENT_TYPE_DOCX_NUMBERING = "application/vnd.openxmlformats-officedocument
|
|
|
37
39
|
var CONTENT_TYPE_DOCX_SETTINGS = "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml";
|
|
38
40
|
var CONTENT_TYPE_DOCX_FONT_TABLE = "application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml";
|
|
39
41
|
var CONTENT_TYPE_DOCX_FOOTNOTES = "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml";
|
|
42
|
+
var CONTENT_TYPE_DOCX_HEADER = "application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml";
|
|
43
|
+
var CONTENT_TYPE_DOCX_FOOTER = "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml";
|
|
40
44
|
var CONTENT_TYPE_PPTX_PRESENTATION = "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml";
|
|
41
45
|
var CONTENT_TYPE_PPTX_SLIDE = "application/vnd.openxmlformats-officedocument.presentationml.slide+xml";
|
|
42
46
|
var CONTENT_TYPE_PPTX_SLIDE_LAYOUT = "application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml";
|
|
@@ -53,37 +57,57 @@ var REL_WORKSHEET = "http://schemas.openxmlformats.org/officeDocument/2006/relat
|
|
|
53
57
|
// src/ooxml/reader.ts
|
|
54
58
|
import { DOMParser as XmldomDOMParser } from "@xmldom/xmldom";
|
|
55
59
|
var packageArchives = /* @__PURE__ */ new WeakMap();
|
|
60
|
+
var packageSignals = /* @__PURE__ */ new WeakMap();
|
|
56
61
|
var MAX_CONTENT_TYPES_BYTES = 1024 * 1024;
|
|
57
62
|
var MAX_RELATIONSHIPS_BYTES = 4 * 1024 * 1024;
|
|
58
|
-
|
|
59
|
-
|
|
63
|
+
var CANCELLATION_CHECKPOINT_INTERVAL = 256;
|
|
64
|
+
function throwIfOoxmlAborted(signal) {
|
|
65
|
+
if (!signal?.aborted) return;
|
|
66
|
+
throw signal.reason ?? new Error("OOXML operation was cancelled");
|
|
67
|
+
}
|
|
68
|
+
async function cancellationCheckpoint(index, signal) {
|
|
69
|
+
throwIfOoxmlAborted(signal);
|
|
70
|
+
if (index > 0 && index % CANCELLATION_CHECKPOINT_INTERVAL === 0) {
|
|
71
|
+
await new Promise((resolve) => setTimeout(resolve, 0));
|
|
72
|
+
throwIfOoxmlAborted(signal);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function parseXml(source, signal) {
|
|
76
|
+
throwIfOoxmlAborted(signal);
|
|
77
|
+
const runtime = globalThis;
|
|
78
|
+
const nativeParser = runtime.process?.versions?.node ? void 0 : runtime.DOMParser;
|
|
60
79
|
const Parser = nativeParser ?? XmldomDOMParser;
|
|
61
80
|
const doc = new Parser().parseFromString(source, "application/xml");
|
|
62
81
|
const parserErrors = doc.getElementsByTagName("parsererror");
|
|
63
82
|
if (parserErrors.length > 0) {
|
|
64
83
|
throw new Error(`Invalid OOXML XML part: ${parserErrors[0]?.textContent ?? "parse error"}`);
|
|
65
84
|
}
|
|
85
|
+
throwIfOoxmlAborted(signal);
|
|
66
86
|
return doc;
|
|
67
87
|
}
|
|
68
88
|
async function openPackage(data, limits = {}) {
|
|
89
|
+
throwIfOoxmlAborted(limits.signal);
|
|
69
90
|
const archive = await openBoundedZipArchive(data, limits);
|
|
70
|
-
const contentTypes = await parseContentTypes(archive);
|
|
71
|
-
const rootRelationships = await parseRelationships(archive, "");
|
|
91
|
+
const contentTypes = await parseContentTypes(archive, limits.signal);
|
|
92
|
+
const rootRelationships = await parseRelationships(archive, "", limits.signal);
|
|
93
|
+
throwIfOoxmlAborted(limits.signal);
|
|
72
94
|
const pkg = {
|
|
73
95
|
contentTypes,
|
|
74
96
|
rootRelationships
|
|
75
97
|
};
|
|
76
98
|
packageArchives.set(pkg, archive);
|
|
99
|
+
if (limits.signal) packageSignals.set(pkg, limits.signal);
|
|
77
100
|
return pkg;
|
|
78
101
|
}
|
|
79
|
-
async function parseContentTypes(archive) {
|
|
102
|
+
async function parseContentTypes(archive, signal) {
|
|
80
103
|
const overrides = /* @__PURE__ */ new Map();
|
|
81
104
|
const defaults = /* @__PURE__ */ new Map();
|
|
82
105
|
const text = await archive.readText("[Content_Types].xml", MAX_CONTENT_TYPES_BYTES);
|
|
83
106
|
if (text === null) return { overrides, defaults };
|
|
84
|
-
const doc = parseXml(text);
|
|
107
|
+
const doc = parseXml(text, signal);
|
|
85
108
|
const defaultEls = doc.getElementsByTagName("Default");
|
|
86
109
|
for (let i = 0; i < defaultEls.length; i++) {
|
|
110
|
+
await cancellationCheckpoint(i, signal);
|
|
87
111
|
const el = defaultEls[i];
|
|
88
112
|
const ext = el.getAttribute("Extension");
|
|
89
113
|
const ct = el.getAttribute("ContentType");
|
|
@@ -91,6 +115,7 @@ async function parseContentTypes(archive) {
|
|
|
91
115
|
}
|
|
92
116
|
const overrideEls = doc.getElementsByTagName("Override");
|
|
93
117
|
for (let i = 0; i < overrideEls.length; i++) {
|
|
118
|
+
await cancellationCheckpoint(i, signal);
|
|
94
119
|
const el = overrideEls[i];
|
|
95
120
|
const partName = el.getAttribute("PartName");
|
|
96
121
|
const ct = el.getAttribute("ContentType");
|
|
@@ -101,18 +126,19 @@ async function parseContentTypes(archive) {
|
|
|
101
126
|
return { overrides, defaults };
|
|
102
127
|
}
|
|
103
128
|
async function getPartRelationships(pkg, partPath) {
|
|
104
|
-
return parseRelationships(pkg, partPath);
|
|
129
|
+
return parseRelationships(pkg, partPath, packageSignals.get(pkg));
|
|
105
130
|
}
|
|
106
|
-
async function parseRelationships(source, partPath) {
|
|
131
|
+
async function parseRelationships(source, partPath, signal) {
|
|
107
132
|
const relsPath = partPath === "" ? "_rels/.rels" : buildRelsPath(partPath);
|
|
108
133
|
const bytes = await readArchivePart(source, relsPath, MAX_RELATIONSHIPS_BYTES);
|
|
109
134
|
if (!bytes) return [];
|
|
110
135
|
const text = new TextDecoder().decode(bytes);
|
|
111
|
-
const doc = parseXml(text);
|
|
136
|
+
const doc = parseXml(text, signal);
|
|
112
137
|
const result = [];
|
|
113
138
|
const els = doc.getElementsByTagNameNS(NS_RELATIONSHIPS, "Relationship");
|
|
114
139
|
const fallbackEls = els.length > 0 ? els : doc.getElementsByTagName("Relationship");
|
|
115
140
|
for (let i = 0; i < fallbackEls.length; i++) {
|
|
141
|
+
await cancellationCheckpoint(i, signal);
|
|
116
142
|
const el = fallbackEls[i];
|
|
117
143
|
const id = el.getAttribute("Id");
|
|
118
144
|
const type = el.getAttribute("Type");
|
|
@@ -139,10 +165,13 @@ function buildRelsPath(partPath) {
|
|
|
139
165
|
return `${dir}/_rels/${file}.rels`;
|
|
140
166
|
}
|
|
141
167
|
async function getPartXml(pkg, partPath) {
|
|
168
|
+
const signal = packageSignals.get(pkg);
|
|
169
|
+
throwIfOoxmlAborted(signal);
|
|
142
170
|
const bytes = await readPackagePart(pkg, partPath);
|
|
143
|
-
return bytes ? parseXml(new TextDecoder().decode(bytes)) : null;
|
|
171
|
+
return bytes ? parseXml(new TextDecoder().decode(bytes), signal) : null;
|
|
144
172
|
}
|
|
145
173
|
async function getPartBinary(pkg, partPath) {
|
|
174
|
+
throwIfOoxmlAborted(packageSignals.get(pkg));
|
|
146
175
|
const bytes = await readPackagePart(pkg, partPath);
|
|
147
176
|
return bytes ? bytes.slice().buffer : null;
|
|
148
177
|
}
|
|
@@ -150,6 +179,7 @@ function readArchivePart(source, path, maxBytes) {
|
|
|
150
179
|
return "entries" in source ? source.read(path, maxBytes) : readPackagePart(source, path, maxBytes);
|
|
151
180
|
}
|
|
152
181
|
async function readPackagePart(pkg, path, maxBytes) {
|
|
182
|
+
throwIfOoxmlAborted(packageSignals.get(pkg));
|
|
153
183
|
const archive = packageArchives.get(pkg);
|
|
154
184
|
if (!archive) {
|
|
155
185
|
throw new TypeError("Invalid OoxmlPackage: create packages with openPackage().");
|
|
@@ -157,6 +187,8 @@ async function readPackagePart(pkg, path, maxBytes) {
|
|
|
157
187
|
return archive.read(path, maxBytes);
|
|
158
188
|
}
|
|
159
189
|
async function getCoreProperties(pkg) {
|
|
190
|
+
const signal = packageSignals.get(pkg);
|
|
191
|
+
throwIfOoxmlAborted(signal);
|
|
160
192
|
const doc = await getPartXml(pkg, "docProps/core.xml");
|
|
161
193
|
if (!doc) return {};
|
|
162
194
|
function getText(ns, localName) {
|
|
@@ -166,7 +198,7 @@ async function getCoreProperties(pkg) {
|
|
|
166
198
|
}
|
|
167
199
|
return void 0;
|
|
168
200
|
}
|
|
169
|
-
|
|
201
|
+
const properties = {
|
|
170
202
|
title: getText(NS_DC, "title"),
|
|
171
203
|
subject: getText(NS_DC, "subject"),
|
|
172
204
|
creator: getText(NS_DC, "creator"),
|
|
@@ -177,6 +209,8 @@ async function getCoreProperties(pkg) {
|
|
|
177
209
|
created: getText(NS_DCTERMS, "created"),
|
|
178
210
|
modified: getText(NS_DCTERMS, "modified")
|
|
179
211
|
};
|
|
212
|
+
throwIfOoxmlAborted(signal);
|
|
213
|
+
return properties;
|
|
180
214
|
}
|
|
181
215
|
|
|
182
216
|
export {
|
|
@@ -192,6 +226,8 @@ export {
|
|
|
192
226
|
REL_HYPERLINK,
|
|
193
227
|
REL_IMAGE,
|
|
194
228
|
REL_FOOTNOTES,
|
|
229
|
+
REL_HEADER,
|
|
230
|
+
REL_FOOTER,
|
|
195
231
|
REL_THEME,
|
|
196
232
|
NS_WML,
|
|
197
233
|
NS_PML,
|
|
@@ -214,6 +250,8 @@ export {
|
|
|
214
250
|
CONTENT_TYPE_DOCX_SETTINGS,
|
|
215
251
|
CONTENT_TYPE_DOCX_FONT_TABLE,
|
|
216
252
|
CONTENT_TYPE_DOCX_FOOTNOTES,
|
|
253
|
+
CONTENT_TYPE_DOCX_HEADER,
|
|
254
|
+
CONTENT_TYPE_DOCX_FOOTER,
|
|
217
255
|
CONTENT_TYPE_PPTX_PRESENTATION,
|
|
218
256
|
CONTENT_TYPE_PPTX_SLIDE,
|
|
219
257
|
CONTENT_TYPE_PPTX_SLIDE_LAYOUT,
|
|
@@ -226,10 +264,11 @@ export {
|
|
|
226
264
|
CONTENT_TYPE_XLSX_WORKSHEET,
|
|
227
265
|
CONTENT_TYPE_XLSX_STYLES,
|
|
228
266
|
REL_WORKSHEET,
|
|
267
|
+
throwIfOoxmlAborted,
|
|
229
268
|
openPackage,
|
|
230
269
|
getPartRelationships,
|
|
231
270
|
getPartXml,
|
|
232
271
|
getPartBinary,
|
|
233
272
|
getCoreProperties
|
|
234
273
|
};
|
|
235
|
-
//# sourceMappingURL=chunk-
|
|
274
|
+
//# sourceMappingURL=chunk-7ARKUCQT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ooxml/namespaces.ts","../src/ooxml/reader.ts"],"sourcesContent":["/**\n * OOXML Namespace Constants\n *\n * All Office Open XML namespace URIs used across DOCX, PPTX, and XLSX.\n * Organized by category for easy reference.\n */\n\n// ============================================\n// Package-level namespaces (shared by all formats)\n// ============================================\n\n/** Relationships namespace (used in _rels/*.rels files) */\nexport const NS_RELATIONSHIPS = 'http://schemas.openxmlformats.org/package/2006/relationships';\n\n/** Content Types namespace ([Content_Types].xml) */\nexport const NS_CONTENT_TYPES = 'http://schemas.openxmlformats.org/package/2006/content-types';\n\n// ============================================\n// Relationship type URIs\n// ============================================\n\n/** Relationship type: Office document (main part) */\nexport const REL_OFFICE_DOCUMENT =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument';\n\n/** Relationship type: Core properties */\nexport const REL_CORE_PROPERTIES =\n 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties';\n\n/** Relationship type: Extended properties (app.xml) */\nexport const REL_EXTENDED_PROPERTIES =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties';\n\n/** Relationship type: Styles */\nexport const REL_STYLES =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles';\n\n/** Relationship type: Numbering */\nexport const REL_NUMBERING =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/numbering';\n\n/** Relationship type: Font table */\nexport const REL_FONT_TABLE =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/fontTable';\n\n/** Relationship type: Settings */\nexport const REL_SETTINGS =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/settings';\n\n/** Relationship type: Hyperlink */\nexport const REL_HYPERLINK =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink';\n\n/** Relationship type: Image */\nexport const REL_IMAGE =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image';\n\n/** Relationship type: Footnotes */\nexport const REL_FOOTNOTES =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/footnotes';\n\n/** Relationship type: Endnotes */\nexport const REL_ENDNOTES =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/endnotes';\n\n/** Relationship type: Header */\nexport const REL_HEADER =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/header';\n\n/** Relationship type: Footer */\nexport const REL_FOOTER =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer';\n\n/** Relationship type: Theme */\nexport const REL_THEME =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/theme';\n\n// ============================================\n// WordprocessingML (DOCX)\n// ============================================\n\n/** WordprocessingML main namespace (w:) */\nexport const NS_WML = 'http://schemas.openxmlformats.org/wordprocessingml/2006/main';\n\n// ============================================\n// PresentationML (PPTX)\n// ============================================\n\n/** PresentationML main namespace (p:) */\nexport const NS_PML = 'http://schemas.openxmlformats.org/presentationml/2006/main';\n\n/** PowerPoint 2010 extension namespace (p14:) */\nexport const NS_PML_2010 = 'http://schemas.microsoft.com/office/powerpoint/2010/main';\n\n// ============================================\n// SpreadsheetML (XLSX)\n// ============================================\n\n/** SpreadsheetML main namespace */\nexport const NS_SML = 'http://schemas.openxmlformats.org/spreadsheetml/2006/main';\n\n// ============================================\n// DrawingML (shared across formats)\n// ============================================\n\n/** DrawingML main namespace (a:) */\nexport const NS_DRAWINGML = 'http://schemas.openxmlformats.org/drawingml/2006/main';\n\n/** DrawingML WordprocessingML drawing namespace (wp:) */\nexport const NS_WP_DRAWING =\n 'http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing';\n\n/** DrawingML picture namespace (pic:) */\nexport const NS_PICTURE = 'http://schemas.openxmlformats.org/drawingml/2006/picture';\n\n// ============================================\n// Dublin Core / Core Properties\n// ============================================\n\n/** Dublin Core elements namespace */\nexport const NS_DC = 'http://purl.org/dc/elements/1.1/';\n\n/** Dublin Core terms namespace */\nexport const NS_DCTERMS = 'http://purl.org/dc/terms/';\n\n/** Core properties namespace */\nexport const NS_CORE_PROPERTIES =\n 'http://schemas.openxmlformats.org/package/2006/metadata/core-properties';\n\n/** XML Schema Instance namespace */\nexport const NS_XSI = 'http://www.w3.org/2001/XMLSchema-instance';\n\n// ============================================\n// Markup Compatibility\n// ============================================\n\n/** Markup Compatibility namespace (mc:) */\nexport const NS_MC = 'http://schemas.openxmlformats.org/markup-compatibility/2006';\n\n/** Office relationships namespace (r:) */\nexport const NS_R = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships';\n\n// ============================================\n// Content type strings\n// ============================================\n\nexport const CONTENT_TYPE_RELATIONSHIPS =\n 'application/vnd.openxmlformats-package.relationships+xml';\n\nexport const CONTENT_TYPE_CORE_PROPERTIES =\n 'application/vnd.openxmlformats-package.core-properties+xml';\n\nexport const CONTENT_TYPE_DOCX_DOCUMENT =\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml';\n\nexport const CONTENT_TYPE_DOCX_STYLES =\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml';\n\nexport const CONTENT_TYPE_DOCX_NUMBERING =\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml';\n\nexport const CONTENT_TYPE_DOCX_SETTINGS =\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml';\n\nexport const CONTENT_TYPE_DOCX_FONT_TABLE =\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml';\n\nexport const CONTENT_TYPE_DOCX_FOOTNOTES =\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml';\n\nexport const CONTENT_TYPE_DOCX_ENDNOTES =\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml';\n\nexport const CONTENT_TYPE_DOCX_HEADER =\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml';\n\nexport const CONTENT_TYPE_DOCX_FOOTER =\n 'application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml';\n\nexport const CONTENT_TYPE_PPTX_PRESENTATION =\n 'application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml';\n\nexport const CONTENT_TYPE_PPTX_SLIDE =\n 'application/vnd.openxmlformats-officedocument.presentationml.slide+xml';\n\nexport const CONTENT_TYPE_PPTX_SLIDE_LAYOUT =\n 'application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml';\n\nexport const CONTENT_TYPE_PPTX_SLIDE_MASTER =\n 'application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml';\n\nexport const CONTENT_TYPE_PPTX_THEME = 'application/vnd.openxmlformats-officedocument.theme+xml';\n\n/** Relationship type: Slide */\nexport const REL_SLIDE =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slide';\n\n/** Relationship type: Slide layout */\nexport const REL_SLIDE_LAYOUT =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideLayout';\n\n/** Relationship type: Slide master */\nexport const REL_SLIDE_MASTER =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/slideMaster';\n\nexport const CONTENT_TYPE_XLSX_WORKBOOK =\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml';\n\nexport const CONTENT_TYPE_XLSX_WORKSHEET =\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml';\n\nexport const CONTENT_TYPE_XLSX_STYLES =\n 'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml';\n\n/** Relationship type: Worksheet */\nexport const REL_WORKSHEET =\n 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet';\n","/**\n * OOXML Package Reader\n *\n * Opens OOXML archives (.docx, .pptx, .xlsx) and parses their\n * structural metadata: [Content_Types].xml, relationships, and\n * core properties.\n *\n * Uses bounded JSZip member streams and a platform DOMParser (with the\n * package-owned xmldom parser in Node/SSR) to parse XML.\n */\n\nimport { DOMParser as XmldomDOMParser } from '@xmldom/xmldom';\nimport type { OoxmlPackage, ContentTypeMap, Relationship, CoreProperties } from './types.js';\nimport { NS_RELATIONSHIPS, NS_DC, NS_DCTERMS, NS_CORE_PROPERTIES } from './namespaces.js';\nimport {\n openBoundedZipArchive,\n type BoundedZipArchive,\n type ZipSafetyLimits,\n} from '../shared/zipSafety.js';\n\nexport type OoxmlOpenOptions = ZipSafetyLimits;\n\ntype DomParserLike = new () => {\n parseFromString(source: string, mimeType: string): unknown;\n};\n\n/** Safe read sessions for opaque packages opened by this module. */\nconst packageArchives = new WeakMap<OoxmlPackage, BoundedZipArchive>();\nconst packageSignals = new WeakMap<OoxmlPackage, AbortSignal>();\nconst MAX_CONTENT_TYPES_BYTES = 1024 * 1024;\nconst MAX_RELATIONSHIPS_BYTES = 4 * 1024 * 1024;\nconst CANCELLATION_CHECKPOINT_INTERVAL = 256;\n\n/** Preserve the caller's exact cancellation reason across OOXML traversal. */\nexport function throwIfOoxmlAborted(signal?: AbortSignal): void {\n if (!signal?.aborted) return;\n throw signal.reason ?? new Error('OOXML operation was cancelled');\n}\n\nasync function cancellationCheckpoint(index: number, signal?: AbortSignal): Promise<void> {\n throwIfOoxmlAborted(signal);\n if (index > 0 && index % CANCELLATION_CHECKPOINT_INTERVAL === 0) {\n await new Promise<void>((resolve) => setTimeout(resolve, 0));\n throwIfOoxmlAborted(signal);\n }\n}\n\n/**\n * Parse XML in browsers and Node. Test runners and SSR hosts can install a\n * partial browser DOMParser whose namespace behavior differs from browsers,\n * so Node always uses the package-owned, namespace-aware xmldom parser.\n */\nfunction parseXml(source: string, signal?: AbortSignal): Document {\n throwIfOoxmlAborted(signal);\n const runtime = globalThis as {\n DOMParser?: DomParserLike;\n process?: { versions?: { node?: string } };\n };\n const nativeParser = runtime.process?.versions?.node ? undefined : runtime.DOMParser;\n const Parser = nativeParser ?? (XmldomDOMParser as unknown as DomParserLike);\n const doc = new Parser().parseFromString(source, 'application/xml') as Document;\n const parserErrors = doc.getElementsByTagName('parsererror');\n if (parserErrors.length > 0) {\n throw new Error(`Invalid OOXML XML part: ${parserErrors[0]?.textContent ?? 'parse error'}`);\n }\n throwIfOoxmlAborted(signal);\n return doc;\n}\n\n// ============================================\n// Package Opening\n// ============================================\n\n/**\n * Open an OOXML package from raw data.\n *\n * Parses the ZIP archive, [Content_Types].xml, and root relationships.\n *\n * @param data - The raw .docx/.pptx/.xlsx file as ArrayBuffer or Blob\n * @param limits - Optional archive count, size, and compression-ratio limits\n * @returns A parsed OoxmlPackage\n */\nexport async function openPackage(\n data: ArrayBuffer | Blob,\n limits: OoxmlOpenOptions = {},\n): Promise<OoxmlPackage> {\n throwIfOoxmlAborted(limits.signal);\n const archive = await openBoundedZipArchive(data, limits);\n const contentTypes = await parseContentTypes(archive, limits.signal);\n const rootRelationships = await parseRelationships(archive, '', limits.signal);\n throwIfOoxmlAborted(limits.signal);\n\n const pkg = {\n contentTypes,\n rootRelationships,\n } as unknown as OoxmlPackage;\n packageArchives.set(pkg, archive);\n if (limits.signal) packageSignals.set(pkg, limits.signal);\n return pkg;\n}\n\n// ============================================\n// Content Types\n// ============================================\n\n/**\n * Parse [Content_Types].xml from the archive.\n */\nasync function parseContentTypes(\n archive: BoundedZipArchive,\n signal?: AbortSignal,\n): Promise<ContentTypeMap> {\n const overrides = new Map<string, string>();\n const defaults = new Map<string, string>();\n\n const text = await archive.readText('[Content_Types].xml', MAX_CONTENT_TYPES_BYTES);\n if (text === null) return { overrides, defaults };\n const doc = parseXml(text, signal);\n\n // Parse <Default Extension=\"rels\" ContentType=\"...\" />\n const defaultEls = doc.getElementsByTagName('Default');\n for (let i = 0; i < defaultEls.length; i++) {\n await cancellationCheckpoint(i, signal);\n const el = defaultEls[i];\n const ext = el.getAttribute('Extension');\n const ct = el.getAttribute('ContentType');\n if (ext && ct) defaults.set(ext, ct);\n }\n\n // Parse <Override PartName=\"/word/document.xml\" ContentType=\"...\" />\n const overrideEls = doc.getElementsByTagName('Override');\n for (let i = 0; i < overrideEls.length; i++) {\n await cancellationCheckpoint(i, signal);\n const el = overrideEls[i];\n const partName = el.getAttribute('PartName');\n const ct = el.getAttribute('ContentType');\n if (partName && ct) {\n // Normalize: strip leading slash\n overrides.set(partName.replace(/^\\//, ''), ct);\n }\n }\n\n return { overrides, defaults };\n}\n\n// ============================================\n// Relationships\n// ============================================\n\n/**\n * Parse relationships for a specific part.\n *\n * @param pkg - The OOXML package (or the zip directly)\n * @param partPath - The part path (e.g., \"word/document.xml\").\n * Use \"\" for root-level relationships (_rels/.rels).\n * @returns Array of relationship entries\n */\nexport async function getPartRelationships(\n pkg: OoxmlPackage,\n partPath: string,\n): Promise<Relationship[]> {\n return parseRelationships(pkg, partPath, packageSignals.get(pkg));\n}\n\n/**\n * Parse a _rels/*.rels file from the ZIP.\n *\n * For root relationships, relsPath = \"_rels/.rels\".\n * For part relationships, relsPath = \"<dir>/_rels/<filename>.rels\".\n */\nasync function parseRelationships(\n source: OoxmlPackage | BoundedZipArchive,\n partPath: string,\n signal?: AbortSignal,\n): Promise<Relationship[]> {\n const relsPath = partPath === '' ? '_rels/.rels' : buildRelsPath(partPath);\n\n const bytes = await readArchivePart(source, relsPath, MAX_RELATIONSHIPS_BYTES);\n if (!bytes) return [];\n const text = new TextDecoder().decode(bytes);\n const doc = parseXml(text, signal);\n const result: Relationship[] = [];\n\n const els = doc.getElementsByTagNameNS(NS_RELATIONSHIPS, 'Relationship');\n // Fallback in case namespace isn't used (some generators omit it)\n const fallbackEls = els.length > 0 ? els : doc.getElementsByTagName('Relationship');\n\n for (let i = 0; i < fallbackEls.length; i++) {\n await cancellationCheckpoint(i, signal);\n const el = fallbackEls[i];\n const id = el.getAttribute('Id');\n const type = el.getAttribute('Type');\n const target = el.getAttribute('Target');\n if (id && type && target) {\n const targetMode = el.getAttribute('TargetMode') as 'Internal' | 'External' | null;\n result.push({\n id,\n type,\n target,\n ...(targetMode ? { targetMode } : {}),\n });\n }\n }\n\n return result;\n}\n\n/**\n * Build the _rels path for a given part path.\n *\n * \"word/document.xml\" → \"word/_rels/document.xml.rels\"\n * \"xl/workbook.xml\" → \"xl/_rels/workbook.xml.rels\"\n */\nfunction buildRelsPath(partPath: string): string {\n const lastSlash = partPath.lastIndexOf('/');\n if (lastSlash === -1) {\n return `_rels/${partPath}.rels`;\n }\n const dir = partPath.substring(0, lastSlash);\n const file = partPath.substring(lastSlash + 1);\n return `${dir}/_rels/${file}.rels`;\n}\n\n// ============================================\n// Part Access\n// ============================================\n\n/**\n * Extract an XML part from the package and parse it as a DOM Document.\n *\n * @param pkg - The OOXML package\n * @param partPath - Path within the archive (e.g., \"word/document.xml\")\n * @returns Parsed XML Document, or null if the part doesn't exist\n */\nexport async function getPartXml(pkg: OoxmlPackage, partPath: string): Promise<Document | null> {\n const signal = packageSignals.get(pkg);\n throwIfOoxmlAborted(signal);\n const bytes = await readPackagePart(pkg, partPath);\n return bytes ? parseXml(new TextDecoder().decode(bytes), signal) : null;\n}\n\n/**\n * Extract a binary part from the package (e.g., an image from word/media/).\n *\n * @param pkg - The OOXML package\n * @param partPath - Path within the archive\n * @returns The binary content, or null if the part doesn't exist\n */\nexport async function getPartBinary(\n pkg: OoxmlPackage,\n partPath: string,\n): Promise<ArrayBuffer | null> {\n throwIfOoxmlAborted(packageSignals.get(pkg));\n const bytes = await readPackagePart(pkg, partPath);\n return bytes ? bytes.slice().buffer : null;\n}\n\nfunction readArchivePart(\n source: OoxmlPackage | BoundedZipArchive,\n path: string,\n maxBytes?: number,\n): Promise<Uint8Array | null> {\n return 'entries' in source\n ? source.read(path, maxBytes)\n : readPackagePart(source, path, maxBytes);\n}\n\nasync function readPackagePart(\n pkg: OoxmlPackage,\n path: string,\n maxBytes?: number,\n): Promise<Uint8Array | null> {\n throwIfOoxmlAborted(packageSignals.get(pkg));\n const archive = packageArchives.get(pkg);\n if (!archive) {\n throw new TypeError('Invalid OoxmlPackage: create packages with openPackage().');\n }\n return archive.read(path, maxBytes);\n}\n\n// ============================================\n// Core Properties\n// ============================================\n\n/**\n * Parse core document properties from docProps/core.xml.\n *\n * @param pkg - The OOXML package\n * @returns Parsed core properties (all fields optional)\n */\nexport async function getCoreProperties(pkg: OoxmlPackage): Promise<CoreProperties> {\n const signal = packageSignals.get(pkg);\n throwIfOoxmlAborted(signal);\n const doc = await getPartXml(pkg, 'docProps/core.xml');\n if (!doc) return {};\n\n function getText(ns: string, localName: string): string | undefined {\n const els = doc!.getElementsByTagNameNS(ns, localName);\n if (els.length > 0 && els[0].textContent) {\n return els[0].textContent;\n }\n return undefined;\n }\n\n const properties = {\n title: getText(NS_DC, 'title'),\n subject: getText(NS_DC, 'subject'),\n creator: getText(NS_DC, 'creator'),\n description: getText(NS_DC, 'description'),\n keywords: getText(NS_CORE_PROPERTIES, 'keywords'),\n lastModifiedBy: getText(NS_CORE_PROPERTIES, 'lastModifiedBy'),\n revision: getText(NS_CORE_PROPERTIES, 'revision'),\n created: getText(NS_DCTERMS, 'created'),\n modified: getText(NS_DCTERMS, 'modified'),\n };\n throwIfOoxmlAborted(signal);\n return properties;\n}\n"],"mappings":";;;;;AAYO,IAAM,mBAAmB;AAGzB,IAAM,mBAAmB;AAOzB,IAAM,sBACX;AAGK,IAAM,sBACX;AAGK,IAAM,0BACX;AAGK,IAAM,aACX;AAGK,IAAM,gBACX;AAGK,IAAM,iBACX;AAGK,IAAM,eACX;AAGK,IAAM,gBACX;AAGK,IAAM,YACX;AAGK,IAAM,gBACX;AAOK,IAAM,aACX;AAGK,IAAM,aACX;AAGK,IAAM,YACX;AAOK,IAAM,SAAS;AAOf,IAAM,SAAS;AAGf,IAAM,cAAc;AAOpB,IAAM,SAAS;AAOf,IAAM,eAAe;AAGrB,IAAM,gBACX;AAGK,IAAM,aAAa;AAOnB,IAAM,QAAQ;AAGd,IAAM,aAAa;AAGnB,IAAM,qBACX;AAGK,IAAM,SAAS;AAOf,IAAM,QAAQ;AAGd,IAAM,OAAO;AAMb,IAAM,6BACX;AAEK,IAAM,+BACX;AAEK,IAAM,6BACX;AAEK,IAAM,2BACX;AAEK,IAAM,8BACX;AAEK,IAAM,6BACX;AAEK,IAAM,+BACX;AAEK,IAAM,8BACX;AAKK,IAAM,2BACX;AAEK,IAAM,2BACX;AAEK,IAAM,i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BAAgB,QAAQ,oBAAoB,gBAAgB;AAAA,IAC5D,UAAU,QAAQ,oBAAoB,UAAU;AAAA,IAChD,SAAS,QAAQ,YAAY,SAAS;AAAA,IACtC,UAAU,QAAQ,YAAY,UAAU;AAAA,EAC1C;AACA,sBAAoB,MAAM;AAC1B,SAAO;AACT;","names":[]}
|
|
@@ -151,7 +151,7 @@ function generateInlineHtml(doc, options) {
|
|
|
151
151
|
*,*::before,*::after{box-sizing:border-box}
|
|
152
152
|
html,body{margin:0;padding:0;height:100%;background:#1a1a2e;color:#e0e0e0;font-family:system-ui,-apple-system,sans-serif}
|
|
153
153
|
#squisq-root{width:100%;height:100%;display:flex;align-items:center;justify-content:center}
|
|
154
|
-
${mode === "static" ? "#squisq-root{
|
|
154
|
+
${mode === "static" ? "#squisq-root{display:block}" : ""}
|
|
155
155
|
</style>
|
|
156
156
|
</head>
|
|
157
157
|
<body>
|
|
@@ -197,7 +197,7 @@ function generateExternalHtml(doc, options) {
|
|
|
197
197
|
*,*::before,*::after{box-sizing:border-box}
|
|
198
198
|
html,body{margin:0;padding:0;height:100%;background:#1a1a2e;color:#e0e0e0;font-family:system-ui,-apple-system,sans-serif}
|
|
199
199
|
#squisq-root{width:100%;height:100%;display:flex;align-items:center;justify-content:center}
|
|
200
|
-
${mode === "static" ? "#squisq-root{
|
|
200
|
+
${mode === "static" ? "#squisq-root{display:block}" : ""}
|
|
201
201
|
</style>
|
|
202
202
|
</head>
|
|
203
203
|
<body>
|
|
@@ -1462,4 +1462,4 @@ export {
|
|
|
1462
1462
|
docToHtml,
|
|
1463
1463
|
docToHtmlZip
|
|
1464
1464
|
};
|
|
1465
|
-
//# sourceMappingURL=chunk-
|
|
1465
|
+
//# sourceMappingURL=chunk-DTDF6QDP.js.map
|