@office-kit/xlsx 0.14.0 → 0.15.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.
Files changed (31) hide show
  1. package/README.md +26 -0
  2. package/dist/{cell-style-BFmJOmcx.mjs → cell-style-CNsET6WU.mjs} +2 -2
  3. package/dist/{cell-style-BFmJOmcx.mjs.map → cell-style-CNsET6WU.mjs.map} +1 -1
  4. package/dist/{differential-H9SjEeIU.mjs → differential-BPKa7wXi.mjs} +2 -2
  5. package/dist/{differential-H9SjEeIU.mjs.map → differential-BPKa7wXi.mjs.map} +1 -1
  6. package/dist/io.mjs +2 -2
  7. package/dist/{iterparse-zWV-5vc6.mjs → iterparse-DZE0zy2M.mjs} +39 -16
  8. package/dist/{iterparse-zWV-5vc6.mjs.map → iterparse-DZE0zy2M.mjs.map} +1 -1
  9. package/dist/{load-B16H5A3S.mjs → load-CspGc399.mjs} +4 -4
  10. package/dist/{load-B16H5A3S.mjs.map → load-CspGc399.mjs.map} +1 -1
  11. package/dist/node.mjs +1 -1
  12. package/dist/{save-I6GjvO1k.mjs → save-DgPf1DyF.mjs} +3 -3
  13. package/dist/{save-I6GjvO1k.mjs.map → save-DgPf1DyF.mjs.map} +1 -1
  14. package/dist/streaming.mjs +5 -5
  15. package/dist/styles.mjs +3 -3
  16. package/dist/{stylesheet-writer-BCS6PzWU.mjs → stylesheet-writer-TxsinwbO.mjs} +6 -6
  17. package/dist/{stylesheet-writer-BCS6PzWU.mjs.map → stylesheet-writer-TxsinwbO.mjs.map} +1 -1
  18. package/dist/{table-Ccro4rrz.mjs → table-BrP0RwUd.mjs} +2 -2
  19. package/dist/{table-Ccro4rrz.mjs.map → table-BrP0RwUd.mjs.map} +1 -1
  20. package/dist/{workbook-B15-T4cs.mjs → workbook-DQCslHzY.mjs} +3 -3
  21. package/dist/{workbook-B15-T4cs.mjs.map → workbook-DQCslHzY.mjs.map} +1 -1
  22. package/dist/workbook.mjs +1 -1
  23. package/dist/worksheet/index.d.ts +1 -1
  24. package/dist/worksheet/ref-batch.d.ts +15 -0
  25. package/dist/worksheet/worksheet.d.ts +33 -0
  26. package/dist/{worksheet-4xW-i8j9.mjs → worksheet-B2NOQ6dM.mjs} +100 -2
  27. package/dist/worksheet-B2NOQ6dM.mjs.map +1 -0
  28. package/dist/worksheet.mjs +3 -3
  29. package/dist/xml.mjs +1 -1
  30. package/package.json +1 -1
  31. package/dist/worksheet-4xW-i8j9.mjs.map +0 -1
@@ -1,4 +1,4 @@
1
- import { en as stableStringify } from "./cell-style-BFmJOmcx.mjs";
1
+ import { en as stableStringify } from "./cell-style-CNsET6WU.mjs";
2
2
  //#region src/styles/differential.ts
3
3
  function makeDifferentialStyle(opts = {}) {
4
4
  const out = {};
@@ -34,4 +34,4 @@ function getDxfs(ss) {
34
34
  //#endregion
35
35
  export { getDxfs as n, makeDifferentialStyle as r, addDxf as t };
36
36
 
37
- //# sourceMappingURL=differential-H9SjEeIU.mjs.map
37
+ //# sourceMappingURL=differential-BPKa7wXi.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"differential-H9SjEeIU.mjs","names":[],"sources":["../src/styles/differential.ts"],"sourcesContent":["// DifferentialStyle (DXF) — partial style overlay used by conditional\n// formatting and Excel-table style elements. Mirrors\n// openpyxl/openpyxl/styles/differential.py.\n//\n// Where a NamedStyle / CellXf carries a *complete* style snapshot, a\n// DifferentialStyle carries only the components that override the base.\n// The Stylesheet keeps DXFs in their own pool (`dxfs`) and conditional-\n// formatting rules / table-style elements reference them by index.\n\nimport { stableStringify } from '../utils/stable-stringify.js';\nimport type { Alignment } from './alignment.js';\nimport type { Border } from './borders.js';\nimport type { Fill } from './fills.js';\nimport type { Font } from './fonts.js';\nimport type { NumberFormat } from './numbers.js';\nimport type { Protection } from './protection.js';\nimport type { Stylesheet } from './stylesheet.js';\n\n/**\n * Differential (\"partial\") style. Every component is optional; only\n * the set fields override the base style of whatever the DXF is\n * applied to.\n */\nexport interface DifferentialStyle {\n readonly font?: Font;\n readonly fill?: Fill;\n readonly border?: Border;\n readonly alignment?: Alignment;\n readonly protection?: Protection;\n /**\n * NumberFormat carries both the id and the format code so DXFs can\n * reference custom user-defined number formats without ambiguity.\n */\n readonly numFmt?: NumberFormat;\n}\n\nexport function makeDifferentialStyle(opts: Partial<DifferentialStyle> = {}): DifferentialStyle {\n const out: { -readonly [K in keyof DifferentialStyle]: DifferentialStyle[K] } = {};\n if (opts.font !== undefined) out.font = opts.font;\n if (opts.fill !== undefined) out.fill = opts.fill;\n if (opts.border !== undefined) out.border = opts.border;\n if (opts.alignment !== undefined) out.alignment = opts.alignment;\n if (opts.protection !== undefined) out.protection = opts.protection;\n if (opts.numFmt !== undefined) out.numFmt = opts.numFmt;\n return Object.freeze(out);\n}\n\n/**\n * Stylesheet pool extension. The DXF list is allocated lazily on first\n * use so empty stylesheets stay slim.\n */\nexport interface StylesheetWithDxfs extends Stylesheet {\n dxfs?: DifferentialStyle[];\n _dxfIdByKey?: Map<string, number>;\n}\n\n/**\n * Add a DifferentialStyle to the stylesheet's `dxfs` pool. Returns\n * the 0-based index. Idempotent on structural equality (via\n * stableStringify).\n */\nexport function addDxf(ss: Stylesheet, dxf: DifferentialStyle): number {\n const w = ss as StylesheetWithDxfs;\n if (w.dxfs === undefined) w.dxfs = [];\n if (w._dxfIdByKey === undefined) w._dxfIdByKey = new Map();\n const key = stableStringify(dxf);\n const cached = w._dxfIdByKey.get(key);\n if (cached !== undefined) return cached;\n const id = w.dxfs.length;\n w.dxfs.push(dxf);\n w._dxfIdByKey.set(key, id);\n return id;\n}\n\n/** Read-only access to the dxfs pool. Returns `[]` when none registered. */\nexport function getDxfs(ss: Stylesheet): ReadonlyArray<DifferentialStyle> {\n return (ss as StylesheetWithDxfs).dxfs ?? [];\n}\n"],"mappings":";;AAoCA,SAAgB,sBAAsB,OAAmC,CAAC,GAAsB;CAC9F,MAAM,MAA0E,CAAC;CACjF,IAAI,KAAK,SAAS,KAAA,GAAW,IAAI,OAAO,KAAK;CAC7C,IAAI,KAAK,SAAS,KAAA,GAAW,IAAI,OAAO,KAAK;CAC7C,IAAI,KAAK,WAAW,KAAA,GAAW,IAAI,SAAS,KAAK;CACjD,IAAI,KAAK,cAAc,KAAA,GAAW,IAAI,YAAY,KAAK;CACvD,IAAI,KAAK,eAAe,KAAA,GAAW,IAAI,aAAa,KAAK;CACzD,IAAI,KAAK,WAAW,KAAA,GAAW,IAAI,SAAS,KAAK;CACjD,OAAO,OAAO,OAAO,GAAG;AAC1B;;;;;;AAgBA,SAAgB,OAAO,IAAgB,KAAgC;CACrE,MAAM,IAAI;CACV,IAAI,EAAE,SAAS,KAAA,GAAW,EAAE,OAAO,CAAC;CACpC,IAAI,EAAE,gBAAgB,KAAA,GAAW,EAAE,8BAAc,IAAI,IAAI;CACzD,MAAM,MAAM,gBAAgB,GAAG;CAC/B,MAAM,SAAS,EAAE,YAAY,IAAI,GAAG;CACpC,IAAI,WAAW,KAAA,GAAW,OAAO;CACjC,MAAM,KAAK,EAAE,KAAK;CAClB,EAAE,KAAK,KAAK,GAAG;CACf,EAAE,YAAY,IAAI,KAAK,EAAE;CACzB,OAAO;AACT;;AAGA,SAAgB,QAAQ,IAAkD;CACxE,OAAQ,GAA0B,QAAQ,CAAC;AAC7C"}
1
+ {"version":3,"file":"differential-BPKa7wXi.mjs","names":[],"sources":["../src/styles/differential.ts"],"sourcesContent":["// DifferentialStyle (DXF) — partial style overlay used by conditional\n// formatting and Excel-table style elements. Mirrors\n// openpyxl/openpyxl/styles/differential.py.\n//\n// Where a NamedStyle / CellXf carries a *complete* style snapshot, a\n// DifferentialStyle carries only the components that override the base.\n// The Stylesheet keeps DXFs in their own pool (`dxfs`) and conditional-\n// formatting rules / table-style elements reference them by index.\n\nimport { stableStringify } from '../utils/stable-stringify.js';\nimport type { Alignment } from './alignment.js';\nimport type { Border } from './borders.js';\nimport type { Fill } from './fills.js';\nimport type { Font } from './fonts.js';\nimport type { NumberFormat } from './numbers.js';\nimport type { Protection } from './protection.js';\nimport type { Stylesheet } from './stylesheet.js';\n\n/**\n * Differential (\"partial\") style. Every component is optional; only\n * the set fields override the base style of whatever the DXF is\n * applied to.\n */\nexport interface DifferentialStyle {\n readonly font?: Font;\n readonly fill?: Fill;\n readonly border?: Border;\n readonly alignment?: Alignment;\n readonly protection?: Protection;\n /**\n * NumberFormat carries both the id and the format code so DXFs can\n * reference custom user-defined number formats without ambiguity.\n */\n readonly numFmt?: NumberFormat;\n}\n\nexport function makeDifferentialStyle(opts: Partial<DifferentialStyle> = {}): DifferentialStyle {\n const out: { -readonly [K in keyof DifferentialStyle]: DifferentialStyle[K] } = {};\n if (opts.font !== undefined) out.font = opts.font;\n if (opts.fill !== undefined) out.fill = opts.fill;\n if (opts.border !== undefined) out.border = opts.border;\n if (opts.alignment !== undefined) out.alignment = opts.alignment;\n if (opts.protection !== undefined) out.protection = opts.protection;\n if (opts.numFmt !== undefined) out.numFmt = opts.numFmt;\n return Object.freeze(out);\n}\n\n/**\n * Stylesheet pool extension. The DXF list is allocated lazily on first\n * use so empty stylesheets stay slim.\n */\nexport interface StylesheetWithDxfs extends Stylesheet {\n dxfs?: DifferentialStyle[];\n _dxfIdByKey?: Map<string, number>;\n}\n\n/**\n * Add a DifferentialStyle to the stylesheet's `dxfs` pool. Returns\n * the 0-based index. Idempotent on structural equality (via\n * stableStringify).\n */\nexport function addDxf(ss: Stylesheet, dxf: DifferentialStyle): number {\n const w = ss as StylesheetWithDxfs;\n if (w.dxfs === undefined) w.dxfs = [];\n if (w._dxfIdByKey === undefined) w._dxfIdByKey = new Map();\n const key = stableStringify(dxf);\n const cached = w._dxfIdByKey.get(key);\n if (cached !== undefined) return cached;\n const id = w.dxfs.length;\n w.dxfs.push(dxf);\n w._dxfIdByKey.set(key, id);\n return id;\n}\n\n/** Read-only access to the dxfs pool. Returns `[]` when none registered. */\nexport function getDxfs(ss: Stylesheet): ReadonlyArray<DifferentialStyle> {\n return (ss as StylesheetWithDxfs).dxfs ?? [];\n}\n"],"mappings":";;AAoCA,SAAgB,sBAAsB,OAAmC,CAAC,GAAsB;CAC9F,MAAM,MAA0E,CAAC;CACjF,IAAI,KAAK,SAAS,KAAA,GAAW,IAAI,OAAO,KAAK;CAC7C,IAAI,KAAK,SAAS,KAAA,GAAW,IAAI,OAAO,KAAK;CAC7C,IAAI,KAAK,WAAW,KAAA,GAAW,IAAI,SAAS,KAAK;CACjD,IAAI,KAAK,cAAc,KAAA,GAAW,IAAI,YAAY,KAAK;CACvD,IAAI,KAAK,eAAe,KAAA,GAAW,IAAI,aAAa,KAAK;CACzD,IAAI,KAAK,WAAW,KAAA,GAAW,IAAI,SAAS,KAAK;CACjD,OAAO,OAAO,OAAO,GAAG;AAC1B;;;;;;AAgBA,SAAgB,OAAO,IAAgB,KAAgC;CACrE,MAAM,IAAI;CACV,IAAI,EAAE,SAAS,KAAA,GAAW,EAAE,OAAO,CAAC;CACpC,IAAI,EAAE,gBAAgB,KAAA,GAAW,EAAE,8BAAc,IAAI,IAAI;CACzD,MAAM,MAAM,gBAAgB,GAAG;CAC/B,MAAM,SAAS,EAAE,YAAY,IAAI,GAAG;CACpC,IAAI,WAAW,KAAA,GAAW,OAAO;CACjC,MAAM,KAAK,EAAE,KAAK;CAClB,EAAE,KAAK,KAAK,GAAG;CACf,EAAE,YAAY,IAAI,KAAK,EAAE;CACzB,OAAO;AACT;;AAGA,SAAgB,QAAQ,IAAkD;CACxE,OAAQ,GAA0B,QAAQ,CAAC;AAC7C"}
package/dist/io.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { i as OpenXmlIoError } from "./exceptions-D-CFwxgm.mjs";
2
- import { t as loadWorkbook } from "./load-B16H5A3S.mjs";
3
- import { n as workbookToBytes, t as saveWorkbook } from "./save-I6GjvO1k.mjs";
2
+ import { t as loadWorkbook } from "./load-CspGc399.mjs";
3
+ import { n as workbookToBytes, t as saveWorkbook } from "./save-DgPf1DyF.mjs";
4
4
  //#region src/io/browser.ts
5
5
  /**
6
6
  * Wrap a Blob (or File, since File extends Blob) as an XlsxSource. The
@@ -2,13 +2,43 @@ import { o as OpenXmlSchemaError } from "./exceptions-D-CFwxgm.mjs";
2
2
  import { jt as qname } from "./tree-BX-sRRVp.mjs";
3
3
  import { SaxesParser } from "saxes";
4
4
  //#region src/xml/iterparse.ts
5
- const DOCTYPE_RE = /<!DOCTYPE\b/;
6
- const ENTITY_RE = /<!ENTITY\b/;
7
- /** Longest token {@link checkDoctype} matches, in code units. */
8
- const DTD_TOKEN_LENGTH = 9;
9
- const checkDoctype = (text) => {
10
- if (DOCTYPE_RE.test(text)) throw new OpenXmlSchemaError("DTD declarations are not permitted in OOXML payloads");
11
- if (ENTITY_RE.test(text)) throw new OpenXmlSchemaError("Entity declarations are not permitted in OOXML payloads");
5
+ /**
6
+ * Recognize declarations only in the prologue, skipping comments and processing
7
+ * instructions. State spans chunks, but retained text is at most one keyword or
8
+ * terminator. Once a root tag begins, saxes handles all remaining syntax checks.
9
+ */
10
+ const makeDtdScanner = () => {
11
+ let state = "prologue";
12
+ let token = "";
13
+ return (chunk) => {
14
+ for (const char of chunk) {
15
+ if (state === "done") return;
16
+ if (state === "comment" || state === "pi") {
17
+ const terminator = state === "comment" ? "-->" : "?>";
18
+ token = (token + char).slice(-terminator.length);
19
+ if (token === terminator) {
20
+ state = "prologue";
21
+ token = "";
22
+ }
23
+ } else if (state === "prologue") {
24
+ if (char === "<") {
25
+ state = "markup";
26
+ token = char;
27
+ }
28
+ } else {
29
+ token += char;
30
+ if (token === "<!--" || token === "<?") {
31
+ state = token === "<!--" ? "comment" : "pi";
32
+ token = "";
33
+ } else if (/^<!DOCTYPE[ \t\r\n]$/.test(token)) throw new OpenXmlSchemaError("DTD declarations are not permitted in OOXML payloads");
34
+ else if (/^<!ENTITY[ \t\r\n]$/.test(token)) throw new OpenXmlSchemaError("Entity declarations are not permitted in OOXML payloads");
35
+ else if (!"<!--".startsWith(token) && !"<!DOCTYPE".startsWith(token) && !"<!ENTITY".startsWith(token)) {
36
+ state = "done";
37
+ token = "";
38
+ }
39
+ }
40
+ }
41
+ };
12
42
  };
13
43
  const isReadableStream = (v) => {
14
44
  return typeof v === "object" && v !== null && typeof v.getReader === "function";
@@ -141,14 +171,7 @@ async function* iterParse(input) {
141
171
  parser.write(chunk);
142
172
  if (pending !== void 0) throw pending;
143
173
  };
144
- const CARRY_LENGTH = DTD_TOKEN_LENGTH - 1;
145
- let dtdCarry = "";
146
- const scanForDtd = (chunk) => {
147
- checkDoctype(chunk);
148
- const window = dtdCarry + chunk.slice(0, CARRY_LENGTH);
149
- if (dtdCarry.length > 0) checkDoctype(window);
150
- dtdCarry = (chunk.length >= CARRY_LENGTH ? chunk : window).slice(-8);
151
- };
174
+ const scanForDtd = makeDtdScanner();
152
175
  for await (const chunk of decodedChunks(input)) {
153
176
  scanForDtd(chunk);
154
177
  feed(chunk);
@@ -161,4 +184,4 @@ async function* iterParse(input) {
161
184
  //#endregion
162
185
  export { iterParse as t };
163
186
 
164
- //# sourceMappingURL=iterparse-zWV-5vc6.mjs.map
187
+ //# sourceMappingURL=iterparse-DZE0zy2M.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"iterparse-zWV-5vc6.mjs","names":[],"sources":["../src/xml/iterparse.ts"],"sourcesContent":["// SAX iterator over OOXML XML payloads. Wraps `saxes` (XMLNS-aware) and yields\n// a flat stream of {start | end | text} events with names already converted to\n// Clark notation (`{ns}local`) — same shape as the DOM parser produces for\n// static XmlNode trees, so consumers can switch between bulk and streaming\n// reads without retouching name comparison.\n//\n// Phase 1 §3 acceptance: 1 k–row sheetData walked end-to-end with cell counts\n// matching the source. The phase-4 read-only worksheet drives real-world use;\n// this layer just produces the events.\n//\n// DOCTYPE / external entity declarations are forbidden. saxes does not expand\n// external entities, but a prescan also rejects DTDs. Every input shape is fed\n// to the parser in chunks, and each chunk is prescanned before it is fed, so\n// the rejection happens before saxes sees the declaration.\n\nimport { SaxesParser } from 'saxes';\nimport { OpenXmlSchemaError } from '../utils/exceptions.js';\nimport { qname } from './namespaces.js';\n\nexport type SaxEvent =\n | { kind: 'start'; name: string; attrs: Record<string, string> }\n | { kind: 'end'; name: string }\n | { kind: 'text'; text: string };\n\n/**\n * Streamable input: `Uint8Array`, plain string, or a Web `ReadableStream` of\n * `Uint8Array` chunks (produced by xlsx zip entries via fflate, fetch, file\n * streams, etc.).\n */\nexport type SaxInput = Uint8Array | string | ReadableStream<Uint8Array>;\n\nconst DOCTYPE_RE = /<!DOCTYPE\\b/;\nconst ENTITY_RE = /<!ENTITY\\b/;\n\n/** Longest token {@link checkDoctype} matches, in code units. */\nconst DTD_TOKEN_LENGTH = '<!DOCTYPE'.length;\n\nconst checkDoctype = (text: string): void => {\n if (DOCTYPE_RE.test(text)) {\n throw new OpenXmlSchemaError('DTD declarations are not permitted in OOXML payloads');\n }\n if (ENTITY_RE.test(text)) {\n throw new OpenXmlSchemaError('Entity declarations are not permitted in OOXML payloads');\n }\n};\n\nconst isReadableStream = (v: unknown): v is ReadableStream<Uint8Array> => {\n return typeof v === 'object' && v !== null && typeof (v as ReadableStream).getReader === 'function';\n};\n\nconst decoder = (): TextDecoder => new TextDecoder('utf-8', { fatal: false });\n\n/**\n * Feed size, in code units. saxes runs its handlers synchronously inside\n * `write()`, so one `write()` queues every event its argument produces before\n * the consumer sees any of them. Capping the argument caps the queue.\n *\n * This bounds every input shape, including a `ReadableStream`, whose upstream\n * chunk size is not ours to choose: the zip reader pushes 64 KB of *compressed*\n * bytes per pull, and worksheet XML inflates roughly sevenfold, so its chunks\n * arrive around 450 KB.\n */\nconst FEED_CHUNK_SIZE = 64 * 1024;\n\n/**\n * Split text that exceeds the feed size. Boundaries fall on arbitrary offsets,\n * which is safe because saxes holds back a lone high surrogate at the end of a\n * `write()` and rejoins it with the next one, so a split codepoint still\n * surfaces as a single text event.\n */\nfunction* atFeedSize(text: string): IterableIterator<string> {\n if (text.length === 0) return;\n if (text.length <= FEED_CHUNK_SIZE) {\n yield text;\n return;\n }\n for (let i = 0; i < text.length; i += FEED_CHUNK_SIZE) {\n yield text.slice(i, i + FEED_CHUNK_SIZE);\n }\n}\n\n/**\n * Decode bytes in feed-sized slices. Slicing before the decode rather than\n * after it also bounds the decoder's output string, which matters when the\n * producer hands over a whole part at once. UTF-8 never expands, so a slice of\n * FEED_CHUNK_SIZE bytes decodes to at most that many code units and needs no\n * second split.\n *\n * `stream: true` holds back a codepoint split across a slice boundary instead\n * of emitting a replacement character for each half.\n */\nfunction* decodeAtFeedSize(bytes: Uint8Array, td: TextDecoder): IterableIterator<string> {\n for (let i = 0; i < bytes.byteLength; i += FEED_CHUNK_SIZE) {\n const text = td.decode(bytes.subarray(i, Math.min(i + FEED_CHUNK_SIZE, bytes.byteLength)), { stream: true });\n if (text.length > 0) yield text;\n }\n}\n\n/** Decode any supported input into a sequence of feed-sized text chunks. */\nasync function* decodedChunks(input: SaxInput): AsyncIterableIterator<string> {\n if (typeof input === 'string') {\n yield* atFeedSize(input);\n return;\n }\n const td = decoder();\n if (input instanceof Uint8Array) {\n yield* decodeAtFeedSize(input, td);\n } else if (isReadableStream(input)) {\n const reader = input.getReader();\n try {\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n yield* decodeAtFeedSize(value, td);\n }\n } finally {\n // Consumers abandon the iteration routinely (`iterRows({ maxRow })`\n // returns as soon as the band ends). Without this the source stays\n // locked and its `cancel()` never runs, which is what releases the zip\n // reader's inflate state. A cancel that rejects is cleanup on a stream\n // nobody will read again, and must not mask why we left the loop.\n await reader.cancel().catch(() => {});\n reader.releaseLock();\n }\n } else {\n throw new OpenXmlSchemaError('iterParse: unsupported input type');\n }\n const tail = td.decode();\n if (tail.length > 0) yield tail;\n}\n\ninterface SaxesOpenTag {\n name: string;\n uri: string;\n local: string;\n prefix: string;\n attributes: Record<string, { value: string; uri: string; local: string; prefix: string }>;\n isSelfClosing?: boolean;\n}\n\ninterface SaxesCloseTag {\n name: string;\n uri: string;\n local: string;\n prefix: string;\n}\n\nconst buildAttrsClark = (attrs: SaxesOpenTag['attributes']): Record<string, string> => {\n const out: Record<string, string> = {};\n for (const [, info] of Object.entries(attrs)) {\n // saxes already resolved the namespace when xmlns: true is set; raw xmlns /\n // xmlns:* declarations have prefix='xmlns' (or local==='xmlns' when\n // default) and we drop those — they're rebuilt by the serializer.\n if (info.prefix === 'xmlns' || (info.prefix === '' && info.local === 'xmlns')) continue;\n const key = qname(info.uri, info.local);\n out[key] = info.value;\n }\n return out;\n};\n\n/**\n * Parse the input as a stream of SAX events. Element / attribute names are\n * returned in Clark notation (`{ns}local`).\n */\nexport async function* iterParse(input: SaxInput): AsyncIterableIterator<SaxEvent> {\n // Set up the parser. xmlns: true gives us resolved {uri, local, prefix} on\n // every open / close tag and on every attribute.\n const parser = new SaxesParser({ xmlns: true, fragment: false });\n\n // Head-pointer ring instead of Array#shift: each saxes write() can produce\n // hundreds of events in a single synchronous batch (a `<row>` with dozens of\n // cells flushes one opentag + one text + one closetag per cell). `shift()`\n // is O(n) per element in V8, so a single-batch drain of N events would be\n // O(N²) before iteration. The head advances on yield; the queue is reset\n // (head + length) once it drains. Peak depth is one chunk's worth of events,\n // which is what keeps the queue bounded on a multi-GB sheet.\n let queue: SaxEvent[] = [];\n let head = 0;\n let pending: Error | undefined;\n\n parser.on('error', (err: Error) => {\n // saxes reports syntax errors as plain Error; consumers of this library\n // only ever see OpenXmlError subclasses.\n pending = new OpenXmlSchemaError(`Malformed XML: ${err.message}`, { cause: err });\n });\n parser.on('doctype', () => {\n pending = new OpenXmlSchemaError('DTD declarations are not permitted in OOXML payloads');\n });\n parser.on('opentag', (node: SaxesOpenTag) => {\n queue.push({ kind: 'start', name: qname(node.uri, node.local), attrs: buildAttrsClark(node.attributes) });\n });\n parser.on('closetag', (node: SaxesCloseTag) => {\n queue.push({ kind: 'end', name: qname(node.uri, node.local) });\n });\n parser.on('text', (text: string) => {\n if (text.length > 0) queue.push({ kind: 'text', text });\n });\n\n const drain = function* (): IterableIterator<SaxEvent> {\n for (;;) {\n const ev = head < queue.length ? queue[head] : undefined;\n if (ev === undefined) {\n // Reset rather than grow forever; the next batch starts at index 0.\n queue = [];\n head = 0;\n return;\n }\n head++;\n yield ev;\n }\n };\n\n const feed = (chunk: string): void => {\n parser.write(chunk);\n if (pending !== undefined) throw pending;\n };\n\n // Scan each chunk on its own, then a short window spanning the boundary, so\n // a `<!DOCTYPE` split across two chunks is still matched. Concatenating the\n // carry onto the whole chunk instead would make V8 flatten a fresh copy of\n // every chunk before the regex could run.\n const CARRY_LENGTH = DTD_TOKEN_LENGTH - 1;\n let dtdCarry = '';\n const scanForDtd = (chunk: string): void => {\n checkDoctype(chunk);\n // Chunks shorter than the carry can hide a token across three of them, so\n // the next carry comes off the joined window rather than the chunk.\n const window = dtdCarry + chunk.slice(0, CARRY_LENGTH);\n if (dtdCarry.length > 0) checkDoctype(window);\n dtdCarry = (chunk.length >= CARRY_LENGTH ? chunk : window).slice(-CARRY_LENGTH);\n };\n\n for await (const chunk of decodedChunks(input)) {\n scanForDtd(chunk);\n feed(chunk);\n yield* drain();\n }\n\n parser.close();\n if (pending !== undefined) throw pending;\n yield* drain();\n}\n"],"mappings":";;;;AA+BA,MAAM,aAAa;AACnB,MAAM,YAAY;;AAGlB,MAAM,mBAAmB;AAEzB,MAAM,gBAAgB,SAAuB;CAC3C,IAAI,WAAW,KAAK,IAAI,GACtB,MAAM,IAAI,mBAAmB,sDAAsD;CAErF,IAAI,UAAU,KAAK,IAAI,GACrB,MAAM,IAAI,mBAAmB,yDAAyD;AAE1F;AAEA,MAAM,oBAAoB,MAAgD;CACxE,OAAO,OAAO,MAAM,YAAY,MAAM,QAAQ,OAAQ,EAAqB,cAAc;AAC3F;AAEA,MAAM,gBAA6B,IAAI,YAAY,SAAS,EAAE,OAAO,MAAM,CAAC;;;;;;;;;;;AAY5E,MAAM,kBAAkB,KAAK;;;;;;;AAQ7B,UAAU,WAAW,MAAwC;CAC3D,IAAI,KAAK,WAAW,GAAG;CACvB,IAAI,KAAK,UAAU,iBA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C5C,YAAY,MAAM,UAAU,eAAe,QAAQ,OAAA,CAAQ,MAAM,EAAa;CAChF;CAEA,WAAW,MAAM,SAAS,cAAc,KAAK,GAAG;EAC9C,WAAW,KAAK;EAChB,KAAK,KAAK;EACV,OAAO,MAAM;CACf;CAEA,OAAO,MAAM;CACb,IAAI,YAAY,KAAA,GAAW,MAAM;CACjC,OAAO,MAAM;AACf"}
1
+ {"version":3,"file":"iterparse-DZE0zy2M.mjs","names":[],"sources":["../src/xml/iterparse.ts"],"sourcesContent":["// SAX iterator over OOXML XML payloads. Wraps `saxes` (XMLNS-aware) and yields\n// a flat stream of {start | end | text} events with names already converted to\n// Clark notation (`{ns}local`) — same shape as the DOM parser produces for\n// static XmlNode trees, so consumers can switch between bulk and streaming\n// reads without retouching name comparison.\n//\n// Phase 1 §3 acceptance: 1 k–row sheetData walked end-to-end with cell counts\n// matching the source. The phase-4 read-only worksheet drives real-world use;\n// this layer just produces the events.\n//\n// DOCTYPE / external entity declarations are forbidden. saxes does not expand\n// external entities, and a prescan rejects a declaration before the parser\n// reaches it. A declaration is only legal in the prologue, so that is how far\n// the prescan reads.\n\nimport { SaxesParser } from 'saxes';\nimport { OpenXmlSchemaError } from '../utils/exceptions.js';\nimport { qname } from './namespaces.js';\n\nexport type SaxEvent =\n | { kind: 'start'; name: string; attrs: Record<string, string> }\n | { kind: 'end'; name: string }\n | { kind: 'text'; text: string };\n\n/**\n * Streamable input: `Uint8Array`, plain string, or a Web `ReadableStream` of\n * `Uint8Array` chunks (produced by xlsx zip entries via fflate, fetch, file\n * streams, etc.).\n */\nexport type SaxInput = Uint8Array | string | ReadableStream<Uint8Array>;\n\n/**\n * Recognize declarations only in the prologue, skipping comments and processing\n * instructions. State spans chunks, but retained text is at most one keyword or\n * terminator. Once a root tag begins, saxes handles all remaining syntax checks.\n */\nconst makeDtdScanner = (): ((chunk: string) => void) => {\n let state: 'prologue' | 'markup' | 'comment' | 'pi' | 'done' = 'prologue';\n let token = '';\n return (chunk) => {\n for (const char of chunk) {\n if (state === 'done') return;\n if (state === 'comment' || state === 'pi') {\n const terminator = state === 'comment' ? '-->' : '?>';\n token = (token + char).slice(-terminator.length);\n if (token === terminator) {\n state = 'prologue';\n token = '';\n }\n } else if (state === 'prologue') {\n if (char === '<') {\n state = 'markup';\n token = char;\n }\n } else {\n token += char;\n if (token === '<!--' || token === '<?') {\n state = token === '<!--' ? 'comment' : 'pi';\n token = '';\n } else if (/^<!DOCTYPE[ \\t\\r\\n]$/.test(token)) {\n throw new OpenXmlSchemaError('DTD declarations are not permitted in OOXML payloads');\n } else if (/^<!ENTITY[ \\t\\r\\n]$/.test(token)) {\n throw new OpenXmlSchemaError('Entity declarations are not permitted in OOXML payloads');\n } else if (!'<!--'.startsWith(token) && !'<!DOCTYPE'.startsWith(token) && !'<!ENTITY'.startsWith(token)) {\n // A root name starts here (or invalid markup, which saxes rejects).\n state = 'done';\n token = '';\n }\n }\n }\n };\n};\n\nconst isReadableStream = (v: unknown): v is ReadableStream<Uint8Array> => {\n return typeof v === 'object' && v !== null && typeof (v as ReadableStream).getReader === 'function';\n};\n\nconst decoder = (): TextDecoder => new TextDecoder('utf-8', { fatal: false });\n\n/**\n * Feed size, in code units. saxes runs its handlers synchronously inside\n * `write()`, so one `write()` queues every event its argument produces before\n * the consumer sees any of them. Capping the argument caps the queue.\n *\n * This bounds every input shape, including a `ReadableStream`, whose upstream\n * chunk size is not ours to choose: the zip reader pushes 64 KB of *compressed*\n * bytes per pull, and worksheet XML inflates roughly sevenfold, so its chunks\n * arrive around 450 KB.\n */\nconst FEED_CHUNK_SIZE = 64 * 1024;\n\n/**\n * Split text that exceeds the feed size. Boundaries fall on arbitrary offsets,\n * which is safe because saxes holds back a lone high surrogate at the end of a\n * `write()` and rejoins it with the next one, so a split codepoint still\n * surfaces as a single text event.\n */\nfunction* atFeedSize(text: string): IterableIterator<string> {\n if (text.length === 0) return;\n if (text.length <= FEED_CHUNK_SIZE) {\n yield text;\n return;\n }\n for (let i = 0; i < text.length; i += FEED_CHUNK_SIZE) {\n yield text.slice(i, i + FEED_CHUNK_SIZE);\n }\n}\n\n/**\n * Decode bytes in feed-sized slices. Slicing before the decode rather than\n * after it also bounds the decoder's output string, which matters when the\n * producer hands over a whole part at once. UTF-8 never expands, so a slice of\n * FEED_CHUNK_SIZE bytes decodes to at most that many code units and needs no\n * second split.\n *\n * `stream: true` holds back a codepoint split across a slice boundary instead\n * of emitting a replacement character for each half.\n */\nfunction* decodeAtFeedSize(bytes: Uint8Array, td: TextDecoder): IterableIterator<string> {\n for (let i = 0; i < bytes.byteLength; i += FEED_CHUNK_SIZE) {\n const text = td.decode(bytes.subarray(i, Math.min(i + FEED_CHUNK_SIZE, bytes.byteLength)), { stream: true });\n if (text.length > 0) yield text;\n }\n}\n\n/** Decode any supported input into a sequence of feed-sized text chunks. */\nasync function* decodedChunks(input: SaxInput): AsyncIterableIterator<string> {\n if (typeof input === 'string') {\n yield* atFeedSize(input);\n return;\n }\n const td = decoder();\n if (input instanceof Uint8Array) {\n yield* decodeAtFeedSize(input, td);\n } else if (isReadableStream(input)) {\n const reader = input.getReader();\n try {\n for (;;) {\n const { done, value } = await reader.read();\n if (done) break;\n yield* decodeAtFeedSize(value, td);\n }\n } finally {\n // Consumers abandon the iteration routinely (`iterRows({ maxRow })`\n // returns as soon as the band ends). Without this the source stays\n // locked and its `cancel()` never runs, which is what releases the zip\n // reader's inflate state. A cancel that rejects is cleanup on a stream\n // nobody will read again, and must not mask why we left the loop.\n await reader.cancel().catch(() => {});\n reader.releaseLock();\n }\n } else {\n throw new OpenXmlSchemaError('iterParse: unsupported input type');\n }\n const tail = td.decode();\n if (tail.length > 0) yield tail;\n}\n\ninterface SaxesOpenTag {\n name: string;\n uri: string;\n local: string;\n prefix: string;\n attributes: Record<string, { value: string; uri: string; local: string; prefix: string }>;\n isSelfClosing?: boolean;\n}\n\ninterface SaxesCloseTag {\n name: string;\n uri: string;\n local: string;\n prefix: string;\n}\n\nconst buildAttrsClark = (attrs: SaxesOpenTag['attributes']): Record<string, string> => {\n const out: Record<string, string> = {};\n for (const [, info] of Object.entries(attrs)) {\n // saxes already resolved the namespace when xmlns: true is set; raw xmlns /\n // xmlns:* declarations have prefix='xmlns' (or local==='xmlns' when\n // default) and we drop those — they're rebuilt by the serializer.\n if (info.prefix === 'xmlns' || (info.prefix === '' && info.local === 'xmlns')) continue;\n const key = qname(info.uri, info.local);\n out[key] = info.value;\n }\n return out;\n};\n\n/**\n * Parse the input as a stream of SAX events. Element / attribute names are\n * returned in Clark notation (`{ns}local`).\n */\nexport async function* iterParse(input: SaxInput): AsyncIterableIterator<SaxEvent> {\n // Set up the parser. xmlns: true gives us resolved {uri, local, prefix} on\n // every open / close tag and on every attribute.\n const parser = new SaxesParser({ xmlns: true, fragment: false });\n\n // Head-pointer ring instead of Array#shift: each saxes write() can produce\n // hundreds of events in a single synchronous batch (a `<row>` with dozens of\n // cells flushes one opentag + one text + one closetag per cell). `shift()`\n // is O(n) per element in V8, so a single-batch drain of N events would be\n // O(N²) before iteration. The head advances on yield; the queue is reset\n // (head + length) once it drains. Peak depth is one chunk's worth of events,\n // which is what keeps the queue bounded on a multi-GB sheet.\n let queue: SaxEvent[] = [];\n let head = 0;\n let pending: Error | undefined;\n\n parser.on('error', (err: Error) => {\n // saxes reports syntax errors as plain Error; consumers of this library\n // only ever see OpenXmlError subclasses.\n pending = new OpenXmlSchemaError(`Malformed XML: ${err.message}`, { cause: err });\n });\n parser.on('doctype', () => {\n pending = new OpenXmlSchemaError('DTD declarations are not permitted in OOXML payloads');\n });\n parser.on('opentag', (node: SaxesOpenTag) => {\n queue.push({ kind: 'start', name: qname(node.uri, node.local), attrs: buildAttrsClark(node.attributes) });\n });\n parser.on('closetag', (node: SaxesCloseTag) => {\n queue.push({ kind: 'end', name: qname(node.uri, node.local) });\n });\n parser.on('text', (text: string) => {\n if (text.length > 0) queue.push({ kind: 'text', text });\n });\n\n const drain = function* (): IterableIterator<SaxEvent> {\n for (;;) {\n const ev = head < queue.length ? queue[head] : undefined;\n if (ev === undefined) {\n // Reset rather than grow forever; the next batch starts at index 0.\n queue = [];\n head = 0;\n return;\n }\n head++;\n yield ev;\n }\n };\n\n const feed = (chunk: string): void => {\n parser.write(chunk);\n if (pending !== undefined) throw pending;\n };\n\n const scanForDtd = makeDtdScanner();\n for await (const chunk of decodedChunks(input)) {\n scanForDtd(chunk);\n feed(chunk);\n yield* drain();\n }\n\n parser.close();\n if (pending !== undefined) throw pending;\n yield* drain();\n}\n"],"mappings":";;;;;;;;;AAoCA,MAAM,uBAAkD;CACtD,IAAI,QAA2D;CAC/D,IAAI,QAAQ;CACZ,QAAQ,UAAU;EAChB,KAAK,MAAM,QAAQ,OAAO;GACxB,IAAI,UAAU,QAAQ;GACtB,IAAI,UAAU,aAAa,UAAU,MAAM;IACzC,MAAM,aAAa,UAAU,YAAY,QAAQ;IACjD,SAAS,QAAQ,KAAA,CAAM,MAAM,CAAC,WAAW,MAAM;IAC/C,IAAI,UAAU,YAAY;KACxB,QAAQ;KACR,QAAQ;IACV;GACF,OAAO,IAAI,UAAU;QACf,SAAS,KAAK;KAChB,QAAQ;KACR,QAAQ;IACV;UACK;IACL,SAAS;IACT,IAAI,UAAU,UAAU,UAAU,MAAM;KACtC,QAAQ,UAAU,SAAS,YAAY;KACvC,QAAQ;IACV,OAAO,IAAI,uBAAuB,KAAK,KAAK,GAC1C,MAAM,IAAI,mBAAmB,sDAAsD;SAC9E,IAAI,sBAAsB,KAAK,KAAK,GACzC,MAAM,IAAI,mBAAmB,yDAAyD;SACjF,IAAI,CAAC,OAAO,WAAW,KAAK,KAAK,CAAC,YAAY,WAAW,KAAK,KAAK,CAAC,WAAW,WAAW,KAAK,GAAG;KAEvG,QAAQ;KACR,QAAQ;IACV;GACF;EACF;CACF;AACF;AAEA,MAAM,oBAAoB,MAAgD;CACxE,OAAO,OAAO,MAAM,YAAY,MAAM,QAAQ,OAAQ,EAAqB,cAAc;AAC3F;AAEA,MAAM,gBAA6B,IA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AM,aAAa,eAAe;CAClC,WAAW,MAAM,SAAS,cAAc,KAAK,GAAG;EAC9C,WAAW,KAAK;EAChB,KAAK,KAAK;EACV,OAAO,MAAM;CACf;CAEA,OAAO,MAAM;CACb,IAAI,YAAY,KAAA,GAAW,MAAM;CACjC,OAAO,MAAM;AACf"}
@@ -1,12 +1,12 @@
1
1
  import { o as OpenXmlSchemaError } from "./exceptions-D-CFwxgm.mjs";
2
2
  import { h as loadImage } from "./drawing-ZJ3h4VHD.mjs";
3
3
  import { At as parseQName, a as findChildren, c as ARC_CONTENT_TYPES, f as ARC_ROOT_RELS, ft as SHEET_MAIN_NS, g as ARC_WORKBOOK, h as ARC_THEME, i as findChild, jt as qname, l as ARC_CORE, lt as REL_NS, m as ARC_STYLE, p as ARC_SHARED_STRINGS, q as MARKUP_COMPAT_NS, s as ARC_APP, u as ARC_CUSTOM } from "./tree-BX-sRRVp.mjs";
4
- import { D as findUserShapesRId, O as parseChartXml, T as parseChartExXml, _ as parseChartsheetXml, a as parseCommentsXml, b as parseWorksheetXml, c as NumberFormatSchema, d as BorderSchema, f as AlignmentSchema, h as parseDrawingXml, l as FontSchema, n as parseTableXml, p as collectRawRelIds, s as ProtectionSchema, u as fillFromTree, w as isChartExBytes, x as parseUserShapesXml } from "./stylesheet-writer-BCS6PzWU.mjs";
4
+ import { D as findUserShapesRId, O as parseChartXml, T as parseChartExXml, _ as parseChartsheetXml, a as parseCommentsXml, b as parseWorksheetXml, c as NumberFormatSchema, d as BorderSchema, f as AlignmentSchema, h as parseDrawingXml, l as FontSchema, n as parseTableXml, p as collectRawRelIds, s as ProtectionSchema, u as fillFromTree, w as isChartExBytes, x as parseUserShapesXml } from "./stylesheet-writer-TxsinwbO.mjs";
5
5
  import { n as parseXmlDocument, t as parseXml } from "./parser-By6RWZVW.mjs";
6
6
  import { t as fromTree } from "./serialize-BC2Wu3bR.mjs";
7
7
  import { B as corePropsFromBytes, Q as findById, _ as customPropsFromBytes, c as extendedPropsFromBytes, et as indexRelsById, nt as relsFromBytes, o as manifestFromBytes, tt as makeRelationships } from "./manifest-pLmx7KYh.mjs";
8
- import { en as stableStringify, ht as makeStylesheet } from "./cell-style-BFmJOmcx.mjs";
9
- import { k as parseSharedStringsXml, r as createWorkbook } from "./workbook-B15-T4cs.mjs";
8
+ import { en as stableStringify, ht as makeStylesheet } from "./cell-style-CNsET6WU.mjs";
9
+ import { k as parseSharedStringsXml, r as createWorkbook } from "./workbook-DQCslHzY.mjs";
10
10
  import { a as makeDefinedName } from "./defined-names-Ctu3F6ls.mjs";
11
11
  import { t as openZip } from "./reader-DHMxLBQV.mjs";
12
12
  //#region src/styles/stylesheet-reader.ts
@@ -1169,4 +1169,4 @@ function capturePassthrough(archive, manifest, wb, roots, vml) {
1169
1169
  //#endregion
1170
1170
  export { parseStylesheetXml as i, parseDate1904 as n, resolveRelTarget as r, loadWorkbook as t };
1171
1171
 
1172
- //# sourceMappingURL=load-B16H5A3S.mjs.map
1172
+ //# sourceMappingURL=load-CspGc399.mjs.map