xls-codec 4.8.0 → 4.10.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 +6 -5
- package/dist/biff/cursor.cjs +12 -1
- package/dist/biff/cursor.d.cts +1 -1
- package/dist/biff/cursor.d.ts +1 -1
- package/dist/biff/cursor.js +12 -1
- package/dist/biff/ptg.cjs +16 -2
- package/dist/biff/ptg.d.cts +2 -2
- package/dist/biff/ptg.d.ts +2 -2
- package/dist/biff/ptg.js +16 -3
- package/dist/biff/record-types.cjs +4 -1
- package/dist/biff/record-types.d.cts +4 -2
- package/dist/biff/record-types.d.ts +4 -2
- package/dist/biff/record-types.js +4 -2
- package/dist/biff/strings.d.cts +1 -1
- package/dist/biff/strings.d.ts +1 -1
- package/dist/biff/xf-colors.d.cts +1 -1
- package/dist/biff/xf-colors.d.ts +1 -1
- package/dist/biff/xf-writer.d.cts +1 -1
- package/dist/biff/xf-writer.d.ts +1 -1
- package/dist/{conditional-format-12-Xl52VBCj.d.ts → conditional-format-12-C3nwy1f8.d.ts} +9 -4
- package/dist/{conditional-format-12-CZ43-CR4.d.cts → conditional-format-12-D65-ruTq.d.cts} +9 -4
- package/dist/conditional-format-BRMUTRP1.d.ts +41 -0
- package/dist/conditional-format-Cth_afMy.d.cts +41 -0
- package/dist/content.cjs +11 -1
- package/dist/content.d.cts +1 -1
- package/dist/content.d.ts +1 -1
- package/dist/content.js +11 -1
- package/dist/{cursor-VMtw9uVP.d.cts → cursor-CnEuX5qE.d.cts} +3 -1
- package/dist/{cursor-VMtw9uVP.d.ts → cursor-CnEuX5qE.d.ts} +3 -1
- package/dist/{data-validation-lJWM9-AP.d.cts → data-validation-BgUt8CbE.d.cts} +1 -1
- package/dist/{data-validation-BeYpL3Nb.d.ts → data-validation-Cq6iD8lB.d.ts} +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/{ptg-CCBbJLZJ.d.cts → ptg-75v7MhaA.d.cts} +7 -1
- package/dist/{ptg-CCBbJLZJ.d.ts → ptg-75v7MhaA.d.ts} +7 -1
- package/dist/workbook/chart.d.cts +1 -1
- package/dist/workbook/chart.d.ts +1 -1
- package/dist/workbook/conditional-format-12.cjs +32 -1
- package/dist/workbook/conditional-format-12.d.cts +2 -2
- package/dist/workbook/conditional-format-12.d.ts +2 -2
- package/dist/workbook/conditional-format-12.js +33 -3
- package/dist/workbook/conditional-format-ex.cjs +53 -0
- package/dist/workbook/conditional-format-ex.d.cts +13 -0
- package/dist/workbook/conditional-format-ex.d.ts +13 -0
- package/dist/workbook/conditional-format-ex.js +52 -0
- package/dist/workbook/conditional-format.cjs +46 -23
- package/dist/workbook/conditional-format.d.cts +2 -2
- package/dist/workbook/conditional-format.d.ts +2 -2
- package/dist/workbook/conditional-format.js +46 -23
- package/dist/workbook/data-validation.d.cts +1 -1
- package/dist/workbook/data-validation.d.ts +1 -1
- package/dist/workbook/drawing.d.cts +1 -1
- package/dist/workbook/drawing.d.ts +1 -1
- package/dist/workbook/encryption.cjs +67 -20
- package/dist/workbook/encryption.d.cts +2 -2
- package/dist/workbook/encryption.d.ts +2 -2
- package/dist/workbook/encryption.js +68 -21
- package/dist/workbook/globals-writer.d.cts +1 -1
- package/dist/workbook/globals-writer.d.ts +1 -1
- package/dist/workbook/globals.d.cts +2 -2
- package/dist/workbook/globals.d.ts +2 -2
- package/dist/workbook/sheet.cjs +11 -0
- package/dist/workbook/sheet.d.cts +4 -4
- package/dist/workbook/sheet.d.ts +4 -4
- package/dist/workbook/sheet.js +12 -1
- package/dist/{xf-colors-mqerVt2O.d.cts → xf-colors-aeH9Ax3Q.d.cts} +1 -1
- package/dist/{xf-colors-d3OvRw76.d.ts → xf-colors-kdNsiNYt.d.ts} +1 -1
- package/package.json +2 -2
- package/dist/conditional-format-Bt1vRWgc.d.cts +0 -29
- package/dist/conditional-format-Cqcjnm7O.d.ts +0 -29
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ What `writeXlsContent`/`writeXls` cover: every `ContentCellValue` kind a real `.
|
|
|
39
39
|
| Images, embedded objects (charts/drawings) | The reader now recovers a sheet's own pictures, charts, and generic drawing shapes (see Read-side gaps below), but writing them back out is its own separate mechanism — a shape's own MS-ODRAW (Escher) container tree, a workbook-wide Blip Store, and (for a chart) a whole nested `BOF`/`EOF` substream, none of which this writer's existing per-record emission has any machinery for — scoped as its own piece of work rather than folded into recovering the read side, the same split this table already draws for `Formula` records. `ContentSheet.images` and `ContentSheet.embeddedObjects` are silently ignored on write. |
|
|
40
40
|
| Defined names (`Lbl`) | Read only for the two built-in ones a sheet's print range and repeated header bands live in ([Print settings](#print-settings)); a user-defined name has nowhere to land in `document-schema.js`'s spreadsheet model, so there is no round trip to verify a writer for it against. |
|
|
41
41
|
| Data validation (`Dv`/`DVal`) | The reader now recovers a sheet's own validation rules (see Read-side gaps below), but writing them back out is its own separate mechanism -- re-encoding a formula's own text back into `Ptg` tokens for `Dv`'s two `DVParsedFormula` fields, the same "not folded into recovering the read side" split this table already draws for `Formula` records. A `ContentSheet.dataValidations` is silently ignored on write. |
|
|
42
|
-
| Conditional formatting (`CondFmt`/`CF`, `CondFmt12`/`CF12`)
|
|
42
|
+
| Conditional formatting (`CondFmt`/`CF`, `CondFmt12`/`CF12`, `CFEx`) | The reader now recovers a sheet's own base `cellIs` rules and every `CF12`/`CFEx` rule this package's schema models (see Read-side gaps below), but writing them back out is its own separate mechanism, the same "not folded into recovering the read side" split this table already draws for `Formula` records and `Dv`. A `ContentSheet.conditionalFormats` is silently ignored on write. |
|
|
43
43
|
| Cell comments (`Note`/`Txo`) | The reader now recovers a cell's comment (see Read-side gaps below), but writing one back out is its own separate mechanism -- a `Note`/`Obj`/`Txo` triple with its own object-id bookkeeping, distinct from every other cell record this writer already emits -- scoped as its own piece of work rather than folded into recovering the read side, the same split this table already draws for `Formula` records. A `ContentSheetCell.comment` is silently ignored on write. |
|
|
44
44
|
| A page size no `iPaperSize` code names | Written as [MS-XLS] 2.4.257's own custom-paper value rather than as a named paper it is not — the dimensions themselves are unwritable, since `Setup` addresses paper only by code. See [Print settings](#print-settings). |
|
|
45
45
|
| `Window1`/`Window2`, `CodePage`, `Index`/`DBCell`, the legacy interface records (`InterfaceHdr`, `WriteAccess`, …) | UI and interoperability bookkeeping [MS-XLS]'s own grammar names in the globals/worksheet substreams alongside the content-carrying records above, not data. `Index`/`DBCell` specifically is a pure cell-lookup performance optimisation (see [MS-XLS]'s own "Retrieval of Last-Calculated Cell Values Without Loading Cell Table") that this reader — and Excel's own reader — does not require to find a cell; real, well-established minimal BIFF8 writers (e.g. Python's `xlwt`) omit the same set and produce files Excel opens correctly. The calculation-state records (`CalcCount`, `CalcRefMode`, `CalcIter`, `CalcDelta`, `CalcSaveRecalc`) sat in this row until print settings needed them — see [Print settings](#print-settings) for why the writer emits them now. |
|
|
@@ -57,11 +57,12 @@ Each deliberate rather than overlooked:
|
|
|
57
57
|
- **Cell comments, resolved for real (ExaDev/documents.js#949).** A legacy BIFF8 comment is split across three record kinds a single self-contained xlsx `<comment>` element never needs: a `Note` record ([MS-XLS] 2.4.179, wrapping a `NoteSh` structure) anchors the comment to a cell and names its author, but carries no text of its own; the text lives in a `Txo` record ([MS-XLS] 2.4.329), its characters carried across trailing `Continue` records; the two are joined through an `Obj` record ([MS-XLS] 2.4.181) whose `FtCmo` names an object id and type, the `Note`'s own `idObj` field naming that same id, and a `Txo` always immediately following the `Obj` record whose shape it belongs to (`src/workbook/comments.ts`). Read in one independent pass over the whole worksheet substream rather than assuming stream order between a `Note` and the `Obj`+`Txo` pair it names -- both are resolved regardless of which comes first. Legacy BIFF8 has no threading and no per-comment timestamp at all (unlike xlsx's own `[MS-XLSX]` threaded-comments extension), so `ContentSheetCellComment.replies` and `.createdAt` are never populated from an `.xls` source; rich per-character formatting within a comment (`TxORuns`) is skipped rather than modelled, the same scope limit this reader already applies to the shared string table's own rich runs, since `ContentSheetCellComment.text` is a plain string with nowhere to carry them.
|
|
58
58
|
- **Data validation, resolved for real (ExaDev/documents.js#1098).** `Dv` ([MS-XLS] 2.4.95) is a fixed, published binary structure -- a bit-packed flags `DWORD` (`valType`/`errStyle`/`fAllowBlank`/`fShowInputMsg`/`fShowErrorMsg`/`typOperator`), four `XLUnicodeString`s (prompt/error titles and messages), one or two `DVParsedFormula` structures, and a trailing `SqRefU` range list -- read directly against that spec (`src/workbook/data-validation.ts`), unlike `calcext:condition`'s own LibreOffice-source-transcribed mini-language odf.js's equivalent reader needed. A `DVParsedFormula`'s own `rgce` is the identical `Ptg` token grammar a cell's `Formula` record carries, so its formula text is recovered with the same `parseFormulaText` this reader already uses for ordinary cell formulas. `DVal` ([MS-XLS] 2.4.96), the record that precedes a sheet's own `Dv` collection, carries only input-window UI state (position, drop-down `Obj` reference) with no counterpart in `ContentSheetDataValidationSchema` and is not read for its own fields.
|
|
59
59
|
- **Charts, drawings, and images, resolved for real (ExaDev/documents.js#924).** A worksheet's own `MsoDrawing` records ([MS-XLS] 2.1.7.20.3-adjacent, `RECORD_MSODRAWING`) carry MS-ODRAW (Escher) bytes that split across as many records as the drawing needs and simply concatenate, in stream order, into one continuous Escher record tree (`src/drawing/escher.ts`, reading [MS-ODRAW]'s own `OfficeArtRecordHeader`/container-vs-atom framing directly against its spec rather than from memory). Within that tree, `src/drawing/shapes.ts` walks the `DgContainer`/`SpgrContainer`/`SpContainer` hierarchy for each real top-level shape's own type, id, and cell anchor (`ClientAnchorSheet`, [MS-XLS] 2.5.163 — one `Sp` atom's `recInstance` and `ClientAnchor`'s corner-cell-plus-fractional-offset pair, 1/1024ths of a cell's width and 1/256ths of its height), skipping the invisible "patriarch" group root every drawing wraps its real shapes in. A picture shape's own `Opt` property table names a `pib` — a 1-based index into the **workbook-wide** Blip Store (`OfficeArtBstoreContainer`, read once from the globals substream's own `MsoDrawingGroup` stream, `src/drawing/blips.ts`) — resolved to real image bytes for a PNG or JPEG blip (`OfficeArtBlipPNG`/`OfficeArtBlipJPEG`'s own literal file bytes, past their `rgbUid` header); a DIB/EMF/WMF/PICT/TIFF blip is recognised but produces no image, since `ContentImageBlockSchema.format` has no lossless slot for any of them. Since neither an Escher shape nor a `MsoDrawing` record names what kind of object it actually holds, each shape is paired 1:1, in document order, with the worksheet substream's own `Obj` records (skipping any Note-type `Obj` `src/workbook/comments.ts` already accounts for) — the same positional correlation every other real BIFF8 reader relies on. An `Obj` naming a **chart** locates the chart's own nested `BOF`(dt=`0x0020`)/`EOF` substream — which sits INSIDE the worksheet substream, immediately after the shape that anchors it ([MS-XLS] "Chart Area") — via `src/biff/substreams.ts`'s own stack-based substream nesting (a genuinely new capability this issue needed: `splitSubstreams` previously treated any BOF met mid-substream as ending it outright, which would have silently dropped every worksheet record written after an embedded chart). `src/workbook/chart.ts` reads that substream's `Series`/`AI` (`BRAI`)/`SeriesText` records — a series' own name and its category/value data links — resolving each link's value either from the chart's own on-disk `SERIESDATA` cache (`Dimensions`/`SIIndex`/`Number`/`BoolErr`/`Blank`/`Label`, present when the chart's data lives on another sheet or is genuinely external) or, for the common case of a chart plotting its own sheet's cells, by resolving the `AI`'s `PtgArea3d`/`PtgRef3d` reference token directly against that sheet's own already-mapped cells — and lands as a `ContentEmbeddedObject` with `objectKind: 'chart'`, its cached series/category table flattened into a small one-sheet spreadsheet `ContentDocument`, the identical shape `ooxml.js`'s own xlsx/pptx chart reading already produces (ExaDev/documents.js#719): `document-schema.js` has no richer, chart-type-aware object model yet, so this reader targets the fallback that exists rather than inventing one. Every other recognised shape (an autoshape, a text box, a line, a group) lands as `objectKind: 'drawing'`, a single-page `ContentDocument` holding one sized-and-positioned `ContentShape` with no text content modelled. Not modelled at all: a shape's own rotation, fill/line formatting, or text runs; a group's own nested transform (a nested nested group's shapes are still recovered, cell-anchored, but a group's own rotation/scale is not composed into its children's positions); and a chart's own type, axes, and legend, which `document-schema.js`'s flattened-table representation has no field for regardless of what this reader could recover.
|
|
60
|
-
- **Conditional formatting, base rules resolved for real (ExaDev/documents.js#1102).** A `CondFmt` record ([MS-XLS] 2.4.56) marks the start of one to three `CF` records ([MS-XLS] 2.4.42) sharing one cell-range list, read together as a group (`src/workbook/conditional-format.ts`) since a `CF`'s own ranges live on its parent `CondFmt`, not on itself. Base BIFF8 (Excel 97) conditional formatting has exactly two rule shapes: a comparison ("Cell Value Is") condition, promoted to `ContentSheetConditionalFormat`'s `cellIs` variant with its formula(s) recovered through the same `parseFormulaText` this reader already uses for cell formulas and `Dv`; and a formula condition, left unpromoted for the same "no closed-form structure without a general formula engine" reason `data-validation.ts` and `ooxml.js`'s own xlsx `cfRule` reading already draw. A rule's resulting style -- font colour and fill background -- comes from its `CF`'s own `DXFN` structure, resolved through the identical `icv`/`Palette` colour machinery a regular cell's fill and border already use ([Cell decoration](#cell-decoration)); a `DXFN` naming a user-defined number format (`DXFNumUsr`) degrades that one rule's style to absent rather than risk misreading the font/fill fields that follow it, since [MS-XLS]'s own prose for `DXFNumUsr`'s length field does not settle whether it counts itself. Every richer rule type Excel 2007+ added has no representation in the base `CF` record at all; it rides a `CF12` record instead,
|
|
60
|
+
- **Conditional formatting, base rules resolved for real (ExaDev/documents.js#1102).** A `CondFmt` record ([MS-XLS] 2.4.56) marks the start of one to three `CF` records ([MS-XLS] 2.4.42) sharing one cell-range list, read together as a group (`src/workbook/conditional-format.ts`) since a `CF`'s own ranges live on its parent `CondFmt`, not on itself. Base BIFF8 (Excel 97) conditional formatting has exactly two rule shapes: a comparison ("Cell Value Is") condition, promoted to `ContentSheetConditionalFormat`'s `cellIs` variant with its formula(s) recovered through the same `parseFormulaText` this reader already uses for cell formulas and `Dv`; and a formula condition, left unpromoted for the same "no closed-form structure without a general formula engine" reason `data-validation.ts` and `ooxml.js`'s own xlsx `cfRule` reading already draw. A rule's resulting style -- font colour and fill background -- comes from its `CF`'s own `DXFN` structure, resolved through the identical `icv`/`Palette` colour machinery a regular cell's fill and border already use ([Cell decoration](#cell-decoration)); a `DXFN` naming a user-defined number format (`DXFNumUsr`) degrades that one rule's style to absent rather than risk misreading the font/fill fields that follow it, since [MS-XLS]'s own prose for `DXFNumUsr`'s length field does not settle whether it counts itself. Every richer rule type Excel 2007+ added has no representation in the base `CF` record at all; it rides a `CF12` record instead, or, for a rule Excel keeps expressible as a legacy formula condition for pre-2007 readers, a `CFEx` extension record that attaches richer metadata to an ordinary `CondFmt`-owned `CF` without promoting it into a `CF12` record at all.
|
|
61
61
|
- **Conditional formatting, CF12's colour scale/data bar/icon set rules resolved for real (ExaDev/documents.js#1104).** `CF12`'s own `ct` field picks one of six rule shapes ([MS-XLS] 2.4.43); this reader promotes the three that share a genuine array-of-thresholds building block already modelled in `document-schema.js` -- colour scale, data bar, and icon set (`src/workbook/conditional-format-12.ts`) -- each reading an array of `CFVO` threshold objects (the identical `num`/`percent`/`max`/`min`/`formula`/`percentile` vocabulary `ContentSheetConditionalFormatValueSchema` already carries for `ooxml.js`'s xlsx reader and `odf.js`'s ods reader) paired with `CFColor` values. A `CFColor` naming an indexed colour resolves through the same `icv`/`Palette` machinery as base `CF`'s own `DXFN`, then Excel's own TintAndShade model applies the colour's own tint/shade Xnum (`xf-colors.ts`'s `applyTint`); one naming a plain RGB triple resolves directly, tint included; one naming an automatic or theme colour degrades the whole rule to absent, since this package has no BIFF8 `Theme` reader to resolve a theme reference against. Icon set's own `iIconSet` byte maps to the identical ECMA-376 `ST_IconSetType` vocabulary (`3Arrows`, `3TrafficLights1`, `5Quarters`, and the rest of the seventeen built-in sets) `ooxml.js`'s xlsx `cfRule` reading already carries as a plain string. A record longer than the 8224-byte single-record ceiling continues onto `ContinueFrt12` rather than the plain `Continue` every other record in this package joins against; `groupRecords` (`src/biff/substreams.ts`) strips its own restated `FrtRefHeader` before joining it.
|
|
62
|
-
- **Conditional formatting, CF12's filter-dispatched template rules resolved for real (ExaDev/documents.js#1106).** `ct` 0x05 ("filter") dispatches further through `icfTemplate`, alongside a 16-byte `CFExTemplateParams` block always present regardless of `ct`. Of that block's five variants, only two need real parsing -- `CFExFilterParams` (top10's own `fTop`/`fPercent`/`iParam`) and `CFExAveragesTemplateParams` (the aboveAverage family's own standard-deviation count) -- since `CFExDefaultTemplateParams` (duplicateValues/uniqueValues/the four blank/error conditions) is 16 reserved bytes and `CFExDateTemplateParams`'s own `dateOp` field is a fixed restatement of `icfTemplate` for all ten date/time periods, so both dispatch directly off `icfTemplate` with no further byte reading. Unlike colour scale/data bar/icon set, [MS-XLS] does not force a `ct` 0x05 rule's own `cbDxf` to zero, so its `DXFN12` can carry a genuine font/fill override; that structure resolves through the identical `parseDxfStyle` base `CF`'s own `DXFN` already uses. A malformed `iParam` of zero degrades a top10 rule to absent rather than promoting a `rank` `ContentSheetConditionalFormatSchema` itself requires to be positive.
|
|
63
|
-
- **
|
|
64
|
-
- **
|
|
62
|
+
- **Conditional formatting, CF12's filter-dispatched template rules resolved for real (ExaDev/documents.js#1106).** `ct` 0x05 ("filter") dispatches further through `icfTemplate`, alongside a 16-byte `CFExTemplateParams` block always present regardless of `ct`. Of that block's five variants, only two need real parsing -- `CFExFilterParams` (top10's own `fTop`/`fPercent`/`iParam`) and `CFExAveragesTemplateParams` (the aboveAverage family's own standard-deviation count) -- since `CFExDefaultTemplateParams` (duplicateValues/uniqueValues/the four blank/error conditions) is 16 reserved bytes and `CFExDateTemplateParams`'s own `dateOp` field is a fixed restatement of `icfTemplate` for all ten date/time periods, so both dispatch directly off `icfTemplate` with no further byte reading. Unlike colour scale/data bar/icon set, [MS-XLS] does not force a `ct` 0x05 rule's own `cbDxf` to zero, so its `DXFN12` can carry a genuine font/fill override; that structure resolves through the identical `parseDxfStyle` base `CF`'s own `DXFN` already uses. A malformed `iParam` of zero degrades a top10 rule to absent rather than promoting a `rank` `ContentSheetConditionalFormatSchema` itself requires to be positive.
|
|
63
|
+
- **Conditional formatting, `containsText`/`notContainsText`/`beginsWith`/`endsWith` and `CFEx`'s own legacy-`CF` extension resolved for real (ExaDev/documents.js#1100).** `icfTemplate` 0x0008 ("Contains text") is the one filter-dispatched template that is NOT actually a `ct` 0x05 rule: `CFExTextTemplateParams` carries only `ctp`, naming which of the four text sub-types a rule is, and neither it nor `ct` 0x05's own `CFFilter` `rgbCT` has anywhere to carry the literal search text (confirmed against a second, independent transcription of both structures -- [kinkou/unxls](https://github.com/kinkou/unxls)'s own `cfextexttemplateparams`/`cffilter` readers, which read `CFFilter` as an unconditional fixed six bytes with no variable trailer). Excel instead expresses these four rule kinds as a genuine `ct` 0x02 formula condition -- either directly on a `CF12` record, or (to stay evaluable by pre-2007 Excel, which silently skips an unrecognised `CF12`/`CondFmt12` "future record" wholesale) via a `CFEx` record ([MS-XLS] 2.4.63) extending an ordinary legacy `CF` -- with the literal text present as a string-constant (`PtgStr`) operand somewhere in the formula's own token stream, matching Excel's real, independently-confirmed generated formula for each sub-type (`NOT(ISERROR(SEARCH("text",cell)))` for `containsText`, and the `ISERROR`/`LEFT`+`LEN`/`RIGHT`+`LEN` equivalents for the other three -- LibreOffice's own `xecontent.cxx` `GetFixedFormula` emits exactly these shapes for its xlsx compatibility formula). `readCfTextFilterRule` (`src/workbook/conditional-format-12.ts`) extracts that operand via `ptg.ts`'s `extractFirstStringLiteral`, reached from both `readCf12`'s own `ct` 0x02 branch and `readCfEx` (`src/workbook/conditional-format-ex.ts`). A `CFEx` record with `fIsCF12` set (extending a genuine `CF12` record rather than a legacy `CF`) stays unread: that `CF12` carries no ranges of its own -- a `CondFmt12` normally supplies them -- and this reader has no established link back to one for it. `CFEx`'s own `nID` cross-references the `nID` field [MS-XLS] 2.1.7.20.6's own worksheet-substream grammar places on every `CondFmt` record (every `CFEx` on a sheet follows every `CondFmt`/`CondFmt12` group, per that same grammar), so `workbook/sheet.ts` keeps a per-`nID` map of each group's own resolved ranges and raw `CF` operands as it walks the substream, for a later `CFEx` to resolve its own `icf` index against.
|
|
64
|
+
- **Not read at all:** a `CFEx` record that extends a genuine `CF12` record rather than a legacy `CF` (see above). Defined names (`Lbl`) are read only for the two built-in ones a sheet's print range and repeated header bands live in ([Print settings](#print-settings)); a user-defined name has nowhere to land in `document-schema.js`'s spreadsheet model, so it is skipped.
|
|
65
|
+
- **RC4-encrypted and XOR-obfuscated workbooks, decrypted for real (ExaDev/documents.js#1108, #922).** A `FilePass` record ([MS-XLS] 2.4.117) means every record after it is ciphertext under one of three schemes; this reader implements two of them, dispatching on the record's own `wEncryptionType` -- the [MS-OFFCRYPTO] 2.3.6.1 "RC4 encryption header" and 2.3.7's own XOR obfuscation (Method 1) -- `readXlsContent`/`readXls` take an optional `password`, verify it against the header's own fields (RC4's `EncryptedVerifier`/`EncryptedVerifierHash`, decrypted then compared; XOR obfuscation's `key`/`verificationBytes`, plain unencrypted checksums compared directly), then decrypt every subsequent record's data (`src/workbook/encryption.ts`) using the RC4/MD5 and XOR-obfuscation primitives [`archive-codec`](../archive-codec/README.md#xor-obfuscation-xlsdoc) shares with `doc-codec`. XOR obfuscation's own per-record `XorArrayIndex` -- `(streamOffset + recordDataLength) % 16`, `recordDataLength` always the record's own full declared size regardless of how much of a given span is actually being decrypted -- is confirmed against a genuine Excel-generated fixture, not just the published spec text (see `archive-codec`'s own account of why that spec text alone is not trustworthy here). [MS-XLS] 2.2.10's own exclusion list -- `BOF`, `FilePass`, and four shared-workbook revision-tracking records this package otherwise never reads, plus `BoundSheet8`'s own `lbPlyPos` field specifically -- is honoured exactly for both schemes, re-derived independently in this package's own tests rather than trusted by construction. A missing or incorrect password throws rather than returning a garbled document; the newer "RC4 CryptoAPI encryption header" scheme remains explicitly out of scope (ppt-codec's own encryption, tracked separately on [#1116](https://github.com/ExaDev/documents.js/issues/1116)).
|
|
65
66
|
|
|
66
67
|
This package is wired into `documents.js`'s conversion registry (`xlsToPdf`/`pdfToXls`, `convertDocument("xls", ...)`, and every same-variant spreadsheet bridge) — see that package's own README Fidelity table for exactly which pairs route and which don't. Remaining read+write scope gaps (formula writing and per-cell font) are tracked on [#815](https://github.com/ExaDev/documents.js/issues/815).
|
|
67
68
|
|
package/dist/biff/cursor.cjs
CHANGED
|
@@ -62,8 +62,19 @@ var BlockCursor = class {
|
|
|
62
62
|
const raw = this.take(8);
|
|
63
63
|
return new DataView(raw.buffer, raw.byteOffset, raw.byteLength).getFloat64(0, true);
|
|
64
64
|
}
|
|
65
|
-
/**
|
|
65
|
+
/** Total unread bytes across the current block and every block after it -- what a length-prefixed field's own prefix must be checked against before that many bytes are allocated, so a record cannot claim a length far larger than the data actually behind it. */
|
|
66
|
+
remainingTotal() {
|
|
67
|
+
this.settle();
|
|
68
|
+
let total = 0;
|
|
69
|
+
for (let index = this.blockIndex; index < this.blocks.length; index += 1) {
|
|
70
|
+
const block = this.blocks[index];
|
|
71
|
+
total += (index === this.blockIndex ? this.remainingInBlock() : block?.length) ?? 0;
|
|
72
|
+
}
|
|
73
|
+
return total;
|
|
74
|
+
}
|
|
75
|
+
/** The next `count` bytes, copied out. Spans block boundaries. Rejects a `count` larger than the data actually remaining before allocating, so a length-prefixed field taken from untrusted input (e.g. CFEx's own `cbDxf`) cannot force a multi-gigabyte allocation from a tiny record. */
|
|
66
76
|
take(count) {
|
|
77
|
+
if (count > this.remainingTotal()) throw new require_biff_records.BiffFormatError(`${count}-byte run requests more data than remains in the record`);
|
|
67
78
|
const out = new Uint8Array(count);
|
|
68
79
|
for (let index = 0; index < count; index += 1) out[index] = this.nextByte(`${count}-byte run`);
|
|
69
80
|
return out;
|
package/dist/biff/cursor.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as BlockCursor } from "../cursor-
|
|
1
|
+
import { t as BlockCursor } from "../cursor-CnEuX5qE.cjs";
|
|
2
2
|
export { BlockCursor };
|
package/dist/biff/cursor.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as BlockCursor } from "../cursor-
|
|
1
|
+
import { t as BlockCursor } from "../cursor-CnEuX5qE.js";
|
|
2
2
|
export { BlockCursor };
|
package/dist/biff/cursor.js
CHANGED
|
@@ -61,8 +61,19 @@ var BlockCursor = class {
|
|
|
61
61
|
const raw = this.take(8);
|
|
62
62
|
return new DataView(raw.buffer, raw.byteOffset, raw.byteLength).getFloat64(0, true);
|
|
63
63
|
}
|
|
64
|
-
/**
|
|
64
|
+
/** Total unread bytes across the current block and every block after it -- what a length-prefixed field's own prefix must be checked against before that many bytes are allocated, so a record cannot claim a length far larger than the data actually behind it. */
|
|
65
|
+
remainingTotal() {
|
|
66
|
+
this.settle();
|
|
67
|
+
let total = 0;
|
|
68
|
+
for (let index = this.blockIndex; index < this.blocks.length; index += 1) {
|
|
69
|
+
const block = this.blocks[index];
|
|
70
|
+
total += (index === this.blockIndex ? this.remainingInBlock() : block?.length) ?? 0;
|
|
71
|
+
}
|
|
72
|
+
return total;
|
|
73
|
+
}
|
|
74
|
+
/** The next `count` bytes, copied out. Spans block boundaries. Rejects a `count` larger than the data actually remaining before allocating, so a length-prefixed field taken from untrusted input (e.g. CFEx's own `cbDxf`) cannot force a multi-gigabyte allocation from a tiny record. */
|
|
65
75
|
take(count) {
|
|
76
|
+
if (count > this.remainingTotal()) throw new BiffFormatError(`${count}-byte run requests more data than remains in the record`);
|
|
66
77
|
const out = new Uint8Array(count);
|
|
67
78
|
for (let index = 0; index < count; index += 1) out[index] = this.nextByte(`${count}-byte run`);
|
|
68
79
|
return out;
|
package/dist/biff/ptg.cjs
CHANGED
|
@@ -336,9 +336,12 @@ function parseFormulaText(rgce, context, options = {}) {
|
|
|
336
336
|
case PTG_MISSARG:
|
|
337
337
|
pushAtomic(stack, "");
|
|
338
338
|
break;
|
|
339
|
-
case PTG_STR:
|
|
340
|
-
|
|
339
|
+
case PTG_STR: {
|
|
340
|
+
const value = require_biff_strings.readShortXLUnicodeString(cursor);
|
|
341
|
+
options.onStringLiteral?.(value);
|
|
342
|
+
pushAtomic(stack, quoteStringLiteral(value));
|
|
341
343
|
break;
|
|
344
|
+
}
|
|
342
345
|
case PTG_ERR: {
|
|
343
346
|
const text = require_biff_errors.errorTextOf(cursor.u8());
|
|
344
347
|
if (text === void 0) return void 0;
|
|
@@ -449,6 +452,16 @@ function parseFormulaText(rgce, context, options = {}) {
|
|
|
449
452
|
}
|
|
450
453
|
return stack.length === 1 ? stack[0]?.text : void 0;
|
|
451
454
|
}
|
|
455
|
+
/**
|
|
456
|
+
* Returns the raw text of the first PtgStr operand `rgce` contains, or undefined if it contains none -- a narrower question than parseFormulaText's own "render the whole formula", answerable even when the formula wraps that operand in functions this reader has no other reason to understand. Exists for conditional-format-12.ts's own readCfTextFilterRule: a CF12/CFExNonCF12 containsText-family rule states which of the four text-comparison sub-types it is via CFExTextTemplateParams.ctp, but carries the literal search text nowhere else but as this operand in its own formula (Excel's real generated shape being e.g. NOT(ISERROR(SEARCH("text",A1))) for containsText -- see conditional-format-ex.ts's own top comment for the full citation). Walks the whole token stream via parseFormulaText's own onStringLiteral hook rather than scanning for the PtgStr opcode directly, since a raw byte scan cannot tell an opcode byte from a length or count belonging to some other token's own payload.
|
|
457
|
+
*/
|
|
458
|
+
function extractFirstStringLiteral(rgce, context) {
|
|
459
|
+
let literal;
|
|
460
|
+
parseFormulaText(rgce, context, { onStringLiteral: (value) => {
|
|
461
|
+
literal ??= value;
|
|
462
|
+
} });
|
|
463
|
+
return literal;
|
|
464
|
+
}
|
|
452
465
|
/** PtgExp's own opcode ([MS-XLS] f9aa266f): 0x01, a reserved bit, then the row/col of the Formula record that carries the shared or array formula's real expression -- see readPtgExpBase. */
|
|
453
466
|
const PTG_EXP_OPCODE = 1;
|
|
454
467
|
/** PtgExp's own fixed size: the opcode byte plus a Rw (2 bytes) and a Col (2 bytes), [MS-XLS] f9aa266f. */
|
|
@@ -468,5 +481,6 @@ function readPtgExpBase(rgce) {
|
|
|
468
481
|
};
|
|
469
482
|
}
|
|
470
483
|
//#endregion
|
|
484
|
+
exports.extractFirstStringLiteral = extractFirstStringLiteral;
|
|
471
485
|
exports.parseFormulaText = parseFormulaText;
|
|
472
486
|
exports.readPtgExpBase = readPtgExpBase;
|
package/dist/biff/ptg.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SheetRange, i as ParseFormulaOptions, n as FormulaOrigin, o as
|
|
2
|
-
export { ExternalSheetLabel, FormulaOrigin, FormulaSheetContext, ParseFormulaOptions, SheetRange, parseFormulaText, readPtgExpBase };
|
|
1
|
+
import { a as SheetRange, c as readPtgExpBase, i as ParseFormulaOptions, n as FormulaOrigin, o as extractFirstStringLiteral, r as FormulaSheetContext, s as parseFormulaText, t as ExternalSheetLabel } from "../ptg-75v7MhaA.cjs";
|
|
2
|
+
export { ExternalSheetLabel, FormulaOrigin, FormulaSheetContext, ParseFormulaOptions, SheetRange, extractFirstStringLiteral, parseFormulaText, readPtgExpBase };
|
package/dist/biff/ptg.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as SheetRange, i as ParseFormulaOptions, n as FormulaOrigin, o as
|
|
2
|
-
export { ExternalSheetLabel, FormulaOrigin, FormulaSheetContext, ParseFormulaOptions, SheetRange, parseFormulaText, readPtgExpBase };
|
|
1
|
+
import { a as SheetRange, c as readPtgExpBase, i as ParseFormulaOptions, n as FormulaOrigin, o as extractFirstStringLiteral, r as FormulaSheetContext, s as parseFormulaText, t as ExternalSheetLabel } from "../ptg-75v7MhaA.js";
|
|
2
|
+
export { ExternalSheetLabel, FormulaOrigin, FormulaSheetContext, ParseFormulaOptions, SheetRange, extractFirstStringLiteral, parseFormulaText, readPtgExpBase };
|
package/dist/biff/ptg.js
CHANGED
|
@@ -335,9 +335,12 @@ function parseFormulaText(rgce, context, options = {}) {
|
|
|
335
335
|
case PTG_MISSARG:
|
|
336
336
|
pushAtomic(stack, "");
|
|
337
337
|
break;
|
|
338
|
-
case PTG_STR:
|
|
339
|
-
|
|
338
|
+
case PTG_STR: {
|
|
339
|
+
const value = readShortXLUnicodeString(cursor);
|
|
340
|
+
options.onStringLiteral?.(value);
|
|
341
|
+
pushAtomic(stack, quoteStringLiteral(value));
|
|
340
342
|
break;
|
|
343
|
+
}
|
|
341
344
|
case PTG_ERR: {
|
|
342
345
|
const text = errorTextOf(cursor.u8());
|
|
343
346
|
if (text === void 0) return void 0;
|
|
@@ -448,6 +451,16 @@ function parseFormulaText(rgce, context, options = {}) {
|
|
|
448
451
|
}
|
|
449
452
|
return stack.length === 1 ? stack[0]?.text : void 0;
|
|
450
453
|
}
|
|
454
|
+
/**
|
|
455
|
+
* Returns the raw text of the first PtgStr operand `rgce` contains, or undefined if it contains none -- a narrower question than parseFormulaText's own "render the whole formula", answerable even when the formula wraps that operand in functions this reader has no other reason to understand. Exists for conditional-format-12.ts's own readCfTextFilterRule: a CF12/CFExNonCF12 containsText-family rule states which of the four text-comparison sub-types it is via CFExTextTemplateParams.ctp, but carries the literal search text nowhere else but as this operand in its own formula (Excel's real generated shape being e.g. NOT(ISERROR(SEARCH("text",A1))) for containsText -- see conditional-format-ex.ts's own top comment for the full citation). Walks the whole token stream via parseFormulaText's own onStringLiteral hook rather than scanning for the PtgStr opcode directly, since a raw byte scan cannot tell an opcode byte from a length or count belonging to some other token's own payload.
|
|
456
|
+
*/
|
|
457
|
+
function extractFirstStringLiteral(rgce, context) {
|
|
458
|
+
let literal;
|
|
459
|
+
parseFormulaText(rgce, context, { onStringLiteral: (value) => {
|
|
460
|
+
literal ??= value;
|
|
461
|
+
} });
|
|
462
|
+
return literal;
|
|
463
|
+
}
|
|
451
464
|
/** PtgExp's own opcode ([MS-XLS] f9aa266f): 0x01, a reserved bit, then the row/col of the Formula record that carries the shared or array formula's real expression -- see readPtgExpBase. */
|
|
452
465
|
const PTG_EXP_OPCODE = 1;
|
|
453
466
|
/** PtgExp's own fixed size: the opcode byte plus a Rw (2 bytes) and a Col (2 bytes), [MS-XLS] f9aa266f. */
|
|
@@ -467,4 +480,4 @@ function readPtgExpBase(rgce) {
|
|
|
467
480
|
};
|
|
468
481
|
}
|
|
469
482
|
//#endregion
|
|
470
|
-
export { parseFormulaText, readPtgExpBase };
|
|
483
|
+
export { extractFirstStringLiteral, parseFormulaText, readPtgExpBase };
|
|
@@ -64,8 +64,10 @@ const RECORD_CONDFMT = 432;
|
|
|
64
64
|
const RECORD_CF = 433;
|
|
65
65
|
/** Marks the start of a collection of CF12 records, the "future record" (FRT) equivalent of CondFmt for the rule types Excel 97's own CF record cannot express ([MS-XLS] 2.4.57). Wraps a CondFmtStructure -- the same ccf/flags/refBound/sqref shape CondFmt's own body carries, just prefixed by a 12-byte FrtRefHeaderU this reader never needs to read. */
|
|
66
66
|
const RECORD_CONDFMT12 = 2169;
|
|
67
|
-
/** One extended conditional-formatting rule: colour scale, data bar, icon set, a filter-dispatched template (top10, aboveAverage, contains-text, a date/time period, …), or a plain comparison/formula rule re-expressed in the newer record shape ([MS-XLS] 2.4.43).
|
|
67
|
+
/** One extended conditional-formatting rule: colour scale, data bar, icon set, a filter-dispatched template (top10, aboveAverage, contains-text, a date/time period, …), or a plain comparison/formula rule re-expressed in the newer record shape ([MS-XLS] 2.4.43). */
|
|
68
68
|
const RECORD_CF12 = 2170;
|
|
69
|
+
/** Extends an existing CondFmt-owned rule with icfTemplate/priority metadata a legacy (Excel 97) CF record has no field for -- CF12's counterpart for a rule Excel keeps expressible as a plain formula condition for pre-2007 readers, most notably the containsText family ([MS-XLS] 2.4.63). Read by workbook/conditional-format-ex.ts. */
|
|
70
|
+
const RECORD_CFEX = 2171;
|
|
69
71
|
/** A cell comment's anchor -- row, column, and its own author, linking to the Obj record that names its text ([MS-XLS] 2.4.179). */
|
|
70
72
|
const RECORD_NOTE = 28;
|
|
71
73
|
/** A drawing object's common properties (id, type) and, for a comment, its FtNts sub-structure ([MS-XLS] 2.4.181). */
|
|
@@ -175,6 +177,7 @@ exports.RECORD_CALCREFMODE = RECORD_CALCREFMODE;
|
|
|
175
177
|
exports.RECORD_CALCSAVERECALC = RECORD_CALCSAVERECALC;
|
|
176
178
|
exports.RECORD_CF = RECORD_CF;
|
|
177
179
|
exports.RECORD_CF12 = RECORD_CF12;
|
|
180
|
+
exports.RECORD_CFEX = RECORD_CFEX;
|
|
178
181
|
exports.RECORD_COLINFO = RECORD_COLINFO;
|
|
179
182
|
exports.RECORD_CONDFMT = RECORD_CONDFMT;
|
|
180
183
|
exports.RECORD_CONDFMT12 = RECORD_CONDFMT12;
|
|
@@ -63,8 +63,10 @@ declare const RECORD_CONDFMT = 432;
|
|
|
63
63
|
declare const RECORD_CF = 433;
|
|
64
64
|
/** Marks the start of a collection of CF12 records, the "future record" (FRT) equivalent of CondFmt for the rule types Excel 97's own CF record cannot express ([MS-XLS] 2.4.57). Wraps a CondFmtStructure -- the same ccf/flags/refBound/sqref shape CondFmt's own body carries, just prefixed by a 12-byte FrtRefHeaderU this reader never needs to read. */
|
|
65
65
|
declare const RECORD_CONDFMT12 = 2169;
|
|
66
|
-
/** One extended conditional-formatting rule: colour scale, data bar, icon set, a filter-dispatched template (top10, aboveAverage, contains-text, a date/time period, …), or a plain comparison/formula rule re-expressed in the newer record shape ([MS-XLS] 2.4.43).
|
|
66
|
+
/** One extended conditional-formatting rule: colour scale, data bar, icon set, a filter-dispatched template (top10, aboveAverage, contains-text, a date/time period, …), or a plain comparison/formula rule re-expressed in the newer record shape ([MS-XLS] 2.4.43). */
|
|
67
67
|
declare const RECORD_CF12 = 2170;
|
|
68
|
+
/** Extends an existing CondFmt-owned rule with icfTemplate/priority metadata a legacy (Excel 97) CF record has no field for -- CF12's counterpart for a rule Excel keeps expressible as a plain formula condition for pre-2007 readers, most notably the containsText family ([MS-XLS] 2.4.63). Read by workbook/conditional-format-ex.ts. */
|
|
69
|
+
declare const RECORD_CFEX = 2171;
|
|
68
70
|
/** A cell comment's anchor -- row, column, and its own author, linking to the Obj record that names its text ([MS-XLS] 2.4.179). */
|
|
69
71
|
declare const RECORD_NOTE = 28;
|
|
70
72
|
/** A drawing object's common properties (id, type) and, for a comment, its FtNts sub-structure ([MS-XLS] 2.4.181). */
|
|
@@ -154,4 +156,4 @@ declare const BIFF8_VERSION = 1536;
|
|
|
154
156
|
/** [MS-XLS] 2.1.4: "The record size ... MUST be less than or equal to 8224." The ceiling a writer splits a record at, and the bound a reader can sanity-check a declared size against. */
|
|
155
157
|
declare const MAX_RECORD_DATA_SIZE = 8224;
|
|
156
158
|
//#endregion
|
|
157
|
-
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF };
|
|
159
|
+
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_CFEX, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF };
|
|
@@ -63,8 +63,10 @@ declare const RECORD_CONDFMT = 432;
|
|
|
63
63
|
declare const RECORD_CF = 433;
|
|
64
64
|
/** Marks the start of a collection of CF12 records, the "future record" (FRT) equivalent of CondFmt for the rule types Excel 97's own CF record cannot express ([MS-XLS] 2.4.57). Wraps a CondFmtStructure -- the same ccf/flags/refBound/sqref shape CondFmt's own body carries, just prefixed by a 12-byte FrtRefHeaderU this reader never needs to read. */
|
|
65
65
|
declare const RECORD_CONDFMT12 = 2169;
|
|
66
|
-
/** One extended conditional-formatting rule: colour scale, data bar, icon set, a filter-dispatched template (top10, aboveAverage, contains-text, a date/time period, …), or a plain comparison/formula rule re-expressed in the newer record shape ([MS-XLS] 2.4.43).
|
|
66
|
+
/** One extended conditional-formatting rule: colour scale, data bar, icon set, a filter-dispatched template (top10, aboveAverage, contains-text, a date/time period, …), or a plain comparison/formula rule re-expressed in the newer record shape ([MS-XLS] 2.4.43). */
|
|
67
67
|
declare const RECORD_CF12 = 2170;
|
|
68
|
+
/** Extends an existing CondFmt-owned rule with icfTemplate/priority metadata a legacy (Excel 97) CF record has no field for -- CF12's counterpart for a rule Excel keeps expressible as a plain formula condition for pre-2007 readers, most notably the containsText family ([MS-XLS] 2.4.63). Read by workbook/conditional-format-ex.ts. */
|
|
69
|
+
declare const RECORD_CFEX = 2171;
|
|
68
70
|
/** A cell comment's anchor -- row, column, and its own author, linking to the Obj record that names its text ([MS-XLS] 2.4.179). */
|
|
69
71
|
declare const RECORD_NOTE = 28;
|
|
70
72
|
/** A drawing object's common properties (id, type) and, for a comment, its FtNts sub-structure ([MS-XLS] 2.4.181). */
|
|
@@ -154,4 +156,4 @@ declare const BIFF8_VERSION = 1536;
|
|
|
154
156
|
/** [MS-XLS] 2.1.4: "The record size ... MUST be less than or equal to 8224." The ceiling a writer splits a record at, and the bound a reader can sanity-check a declared size against. */
|
|
155
157
|
declare const MAX_RECORD_DATA_SIZE = 8224;
|
|
156
158
|
//#endregion
|
|
157
|
-
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF };
|
|
159
|
+
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_CFEX, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF };
|
|
@@ -63,8 +63,10 @@ const RECORD_CONDFMT = 432;
|
|
|
63
63
|
const RECORD_CF = 433;
|
|
64
64
|
/** Marks the start of a collection of CF12 records, the "future record" (FRT) equivalent of CondFmt for the rule types Excel 97's own CF record cannot express ([MS-XLS] 2.4.57). Wraps a CondFmtStructure -- the same ccf/flags/refBound/sqref shape CondFmt's own body carries, just prefixed by a 12-byte FrtRefHeaderU this reader never needs to read. */
|
|
65
65
|
const RECORD_CONDFMT12 = 2169;
|
|
66
|
-
/** One extended conditional-formatting rule: colour scale, data bar, icon set, a filter-dispatched template (top10, aboveAverage, contains-text, a date/time period, …), or a plain comparison/formula rule re-expressed in the newer record shape ([MS-XLS] 2.4.43).
|
|
66
|
+
/** One extended conditional-formatting rule: colour scale, data bar, icon set, a filter-dispatched template (top10, aboveAverage, contains-text, a date/time period, …), or a plain comparison/formula rule re-expressed in the newer record shape ([MS-XLS] 2.4.43). */
|
|
67
67
|
const RECORD_CF12 = 2170;
|
|
68
|
+
/** Extends an existing CondFmt-owned rule with icfTemplate/priority metadata a legacy (Excel 97) CF record has no field for -- CF12's counterpart for a rule Excel keeps expressible as a plain formula condition for pre-2007 readers, most notably the containsText family ([MS-XLS] 2.4.63). Read by workbook/conditional-format-ex.ts. */
|
|
69
|
+
const RECORD_CFEX = 2171;
|
|
68
70
|
/** A cell comment's anchor -- row, column, and its own author, linking to the Obj record that names its text ([MS-XLS] 2.4.179). */
|
|
69
71
|
const RECORD_NOTE = 28;
|
|
70
72
|
/** A drawing object's common properties (id, type) and, for a comment, its FtNts sub-structure ([MS-XLS] 2.4.181). */
|
|
@@ -154,4 +156,4 @@ const BIFF8_VERSION = 1536;
|
|
|
154
156
|
/** [MS-XLS] 2.1.4: "The record size ... MUST be less than or equal to 8224." The ceiling a writer splits a record at, and the bound a reader can sanity-check a declared size against. */
|
|
155
157
|
const MAX_RECORD_DATA_SIZE = 8224;
|
|
156
158
|
//#endregion
|
|
157
|
-
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF };
|
|
159
|
+
export { BIFF8_VERSION, BOF_TYPE_CHART, BOF_TYPE_MACRO, BOF_TYPE_WORKBOOK, BOF_TYPE_WORKSHEET, MAX_RECORD_DATA_SIZE, RECORD_AI, RECORD_ARRAY, RECORD_BLANK, RECORD_BOF, RECORD_BOOLERR, RECORD_BOTTOMMARGIN, RECORD_BOUNDSHEET8, RECORD_CALCCOUNT, RECORD_CALCDELTA, RECORD_CALCITER, RECORD_CALCREFMODE, RECORD_CALCSAVERECALC, RECORD_CF, RECORD_CF12, RECORD_CFEX, RECORD_COLINFO, RECORD_CONDFMT, RECORD_CONDFMT12, RECORD_CONTINUE, RECORD_CONTINUEFRT12, RECORD_DATE1904, RECORD_DEFAULTROWHEIGHT, RECORD_DEFCOLWIDTH, RECORD_DIMENSIONS, RECORD_DV, RECORD_DVAL, RECORD_EOF, RECORD_EXTERNSHEET, RECORD_FILELOCK, RECORD_FILEPASS, RECORD_FONT, RECORD_FORMAT, RECORD_FORMULA, RECORD_HORIZONTALPAGEBREAKS, RECORD_INTERFACEHDR, RECORD_LABEL, RECORD_LABELSST, RECORD_LBL, RECORD_LEFTMARGIN, RECORD_MERGECELLS, RECORD_MSODRAWING, RECORD_MSODRAWINGGROUP, RECORD_MSODRAWINGSELECTION, RECORD_MULBLANK, RECORD_MULRK, RECORD_NOTE, RECORD_NUMBER, RECORD_OBJ, RECORD_PALETTE, RECORD_PRINTGRID, RECORD_PRINTROWCOL, RECORD_RIGHTMARGIN, RECORD_RK, RECORD_ROW, RECORD_RRDHEAD, RECORD_RRDINFO, RECORD_SERIES, RECORD_SERIESTEXT, RECORD_SETUP, RECORD_SHRFMLA, RECORD_SIINDEX, RECORD_SST, RECORD_STRING, RECORD_STYLE, RECORD_SUPBOOK, RECORD_TABLE, RECORD_TOPMARGIN, RECORD_TXO, RECORD_USREXCL, RECORD_VERTICALPAGEBREAKS, RECORD_WSBOOL, RECORD_XF };
|
package/dist/biff/strings.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BlockCursor } from "../cursor-
|
|
1
|
+
import { t as BlockCursor } from "../cursor-CnEuX5qE.cjs";
|
|
2
2
|
//#region src/biff/strings.d.ts
|
|
3
3
|
/** An XLUnicodeString ([MS-XLS] 2.5.294): a two-byte character count, a flags byte, then the characters. Continuable, since the String record ([MS-XLS] 2.4.268) carrying a formula's string result is one of these and its own production admits trailing Continues. */
|
|
4
4
|
declare function readXLUnicodeString(cursor: BlockCursor): string;
|
package/dist/biff/strings.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as BlockCursor } from "../cursor-
|
|
1
|
+
import { t as BlockCursor } from "../cursor-CnEuX5qE.js";
|
|
2
2
|
//#region src/biff/strings.d.ts
|
|
3
3
|
/** An XLUnicodeString ([MS-XLS] 2.5.294): a two-byte character count, a flags byte, then the characters. Continuable, since the String record ([MS-XLS] 2.4.268) carrying a formula's string result is one of these and its own production admits trailing Continues. */
|
|
4
4
|
declare function readXLUnicodeString(cursor: BlockCursor): string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as longRgbBytesOf, B as vertAlignTokenFor, C as UNDECORATED_XF_FIELDS, D as applyTint, E as XfDecorationFields, F as resolveHorizontalAlignment, I as resolveIcvColor, L as resolveVerticalAlignment, M as readLongRgbColor, N as resolveBorderEdge, O as borderStyleTokenFor, P as resolveFillBackground, R as unpackXfAlignment, S as PATTERN_TYPE_TO_FILL_PATTERN, T as XfBorderEdge, _ as FILL_PATTERN_SOLID, a as BORDER_STYLE_DOUBLE, b as PALETTE_BASE_ICV, c as BORDER_STYLE_MEDIUM_DASHDOT, d as BORDER_STYLE_NONE, f as BORDER_STYLE_SLANT_DASHDOT, g as FILL_PATTERN_NONE, h as DEFAULT_PALETTE_HEX_TO_ICV, i as BORDER_STYLE_DOTTED, j as packXfDecorationWords, k as horizAlignTokenFor, l as BORDER_STYLE_MEDIUM_DASHDOTDOT, m as BORDER_STYLE_THIN, n as BORDER_STYLE_DASHDOTDOT, o as BORDER_STYLE_HAIR, p as BORDER_STYLE_THICK, r as BORDER_STYLE_DASHED, s as BORDER_STYLE_MEDIUM, t as BORDER_STYLE_DASHDOT, u as BORDER_STYLE_MEDIUM_DASHED, v as ICV_AUTOMATIC_BACKGROUND, w as XfAlignmentFields, x as PALETTE_ENTRY_COUNT, y as ICV_AUTOMATIC_FOREGROUND, z as unpackXfDecoration } from "../xf-colors-
|
|
1
|
+
import { A as longRgbBytesOf, B as vertAlignTokenFor, C as UNDECORATED_XF_FIELDS, D as applyTint, E as XfDecorationFields, F as resolveHorizontalAlignment, I as resolveIcvColor, L as resolveVerticalAlignment, M as readLongRgbColor, N as resolveBorderEdge, O as borderStyleTokenFor, P as resolveFillBackground, R as unpackXfAlignment, S as PATTERN_TYPE_TO_FILL_PATTERN, T as XfBorderEdge, _ as FILL_PATTERN_SOLID, a as BORDER_STYLE_DOUBLE, b as PALETTE_BASE_ICV, c as BORDER_STYLE_MEDIUM_DASHDOT, d as BORDER_STYLE_NONE, f as BORDER_STYLE_SLANT_DASHDOT, g as FILL_PATTERN_NONE, h as DEFAULT_PALETTE_HEX_TO_ICV, i as BORDER_STYLE_DOTTED, j as packXfDecorationWords, k as horizAlignTokenFor, l as BORDER_STYLE_MEDIUM_DASHDOTDOT, m as BORDER_STYLE_THIN, n as BORDER_STYLE_DASHDOTDOT, o as BORDER_STYLE_HAIR, p as BORDER_STYLE_THICK, r as BORDER_STYLE_DASHED, s as BORDER_STYLE_MEDIUM, t as BORDER_STYLE_DASHDOT, u as BORDER_STYLE_MEDIUM_DASHED, v as ICV_AUTOMATIC_BACKGROUND, w as XfAlignmentFields, x as PALETTE_ENTRY_COUNT, y as ICV_AUTOMATIC_FOREGROUND, z as unpackXfDecoration } from "../xf-colors-aeH9Ax3Q.cjs";
|
|
2
2
|
export { BORDER_STYLE_DASHDOT, BORDER_STYLE_DASHDOTDOT, BORDER_STYLE_DASHED, BORDER_STYLE_DOTTED, BORDER_STYLE_DOUBLE, BORDER_STYLE_HAIR, BORDER_STYLE_MEDIUM, BORDER_STYLE_MEDIUM_DASHDOT, BORDER_STYLE_MEDIUM_DASHDOTDOT, BORDER_STYLE_MEDIUM_DASHED, BORDER_STYLE_NONE, BORDER_STYLE_SLANT_DASHDOT, BORDER_STYLE_THICK, BORDER_STYLE_THIN, DEFAULT_PALETTE_HEX_TO_ICV, FILL_PATTERN_NONE, FILL_PATTERN_SOLID, ICV_AUTOMATIC_BACKGROUND, ICV_AUTOMATIC_FOREGROUND, PALETTE_BASE_ICV, PALETTE_ENTRY_COUNT, PATTERN_TYPE_TO_FILL_PATTERN, UNDECORATED_XF_FIELDS, XfAlignmentFields, XfBorderEdge, XfDecorationFields, applyTint, borderStyleTokenFor, horizAlignTokenFor, longRgbBytesOf, packXfDecorationWords, readLongRgbColor, resolveBorderEdge, resolveFillBackground, resolveHorizontalAlignment, resolveIcvColor, resolveVerticalAlignment, unpackXfAlignment, unpackXfDecoration, vertAlignTokenFor };
|
package/dist/biff/xf-colors.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as longRgbBytesOf, B as vertAlignTokenFor, C as UNDECORATED_XF_FIELDS, D as applyTint, E as XfDecorationFields, F as resolveHorizontalAlignment, I as resolveIcvColor, L as resolveVerticalAlignment, M as readLongRgbColor, N as resolveBorderEdge, O as borderStyleTokenFor, P as resolveFillBackground, R as unpackXfAlignment, S as PATTERN_TYPE_TO_FILL_PATTERN, T as XfBorderEdge, _ as FILL_PATTERN_SOLID, a as BORDER_STYLE_DOUBLE, b as PALETTE_BASE_ICV, c as BORDER_STYLE_MEDIUM_DASHDOT, d as BORDER_STYLE_NONE, f as BORDER_STYLE_SLANT_DASHDOT, g as FILL_PATTERN_NONE, h as DEFAULT_PALETTE_HEX_TO_ICV, i as BORDER_STYLE_DOTTED, j as packXfDecorationWords, k as horizAlignTokenFor, l as BORDER_STYLE_MEDIUM_DASHDOTDOT, m as BORDER_STYLE_THIN, n as BORDER_STYLE_DASHDOTDOT, o as BORDER_STYLE_HAIR, p as BORDER_STYLE_THICK, r as BORDER_STYLE_DASHED, s as BORDER_STYLE_MEDIUM, t as BORDER_STYLE_DASHDOT, u as BORDER_STYLE_MEDIUM_DASHED, v as ICV_AUTOMATIC_BACKGROUND, w as XfAlignmentFields, x as PALETTE_ENTRY_COUNT, y as ICV_AUTOMATIC_FOREGROUND, z as unpackXfDecoration } from "../xf-colors-
|
|
1
|
+
import { A as longRgbBytesOf, B as vertAlignTokenFor, C as UNDECORATED_XF_FIELDS, D as applyTint, E as XfDecorationFields, F as resolveHorizontalAlignment, I as resolveIcvColor, L as resolveVerticalAlignment, M as readLongRgbColor, N as resolveBorderEdge, O as borderStyleTokenFor, P as resolveFillBackground, R as unpackXfAlignment, S as PATTERN_TYPE_TO_FILL_PATTERN, T as XfBorderEdge, _ as FILL_PATTERN_SOLID, a as BORDER_STYLE_DOUBLE, b as PALETTE_BASE_ICV, c as BORDER_STYLE_MEDIUM_DASHDOT, d as BORDER_STYLE_NONE, f as BORDER_STYLE_SLANT_DASHDOT, g as FILL_PATTERN_NONE, h as DEFAULT_PALETTE_HEX_TO_ICV, i as BORDER_STYLE_DOTTED, j as packXfDecorationWords, k as horizAlignTokenFor, l as BORDER_STYLE_MEDIUM_DASHDOTDOT, m as BORDER_STYLE_THIN, n as BORDER_STYLE_DASHDOTDOT, o as BORDER_STYLE_HAIR, p as BORDER_STYLE_THICK, r as BORDER_STYLE_DASHED, s as BORDER_STYLE_MEDIUM, t as BORDER_STYLE_DASHDOT, u as BORDER_STYLE_MEDIUM_DASHED, v as ICV_AUTOMATIC_BACKGROUND, w as XfAlignmentFields, x as PALETTE_ENTRY_COUNT, y as ICV_AUTOMATIC_FOREGROUND, z as unpackXfDecoration } from "../xf-colors-kdNsiNYt.js";
|
|
2
2
|
export { BORDER_STYLE_DASHDOT, BORDER_STYLE_DASHDOTDOT, BORDER_STYLE_DASHED, BORDER_STYLE_DOTTED, BORDER_STYLE_DOUBLE, BORDER_STYLE_HAIR, BORDER_STYLE_MEDIUM, BORDER_STYLE_MEDIUM_DASHDOT, BORDER_STYLE_MEDIUM_DASHDOTDOT, BORDER_STYLE_MEDIUM_DASHED, BORDER_STYLE_NONE, BORDER_STYLE_SLANT_DASHDOT, BORDER_STYLE_THICK, BORDER_STYLE_THIN, DEFAULT_PALETTE_HEX_TO_ICV, FILL_PATTERN_NONE, FILL_PATTERN_SOLID, ICV_AUTOMATIC_BACKGROUND, ICV_AUTOMATIC_FOREGROUND, PALETTE_BASE_ICV, PALETTE_ENTRY_COUNT, PATTERN_TYPE_TO_FILL_PATTERN, UNDECORATED_XF_FIELDS, XfAlignmentFields, XfBorderEdge, XfDecorationFields, applyTint, borderStyleTokenFor, horizAlignTokenFor, longRgbBytesOf, packXfDecorationWords, readLongRgbColor, resolveBorderEdge, resolveFillBackground, resolveHorizontalAlignment, resolveIcvColor, resolveVerticalAlignment, unpackXfAlignment, unpackXfDecoration, vertAlignTokenFor };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as XfDecorationFields } from "../xf-colors-
|
|
1
|
+
import { E as XfDecorationFields } from "../xf-colors-aeH9Ax3Q.cjs";
|
|
2
2
|
import { Alignment, Color } from "document-schema.js";
|
|
3
3
|
//#region src/biff/xf-writer.d.ts
|
|
4
4
|
/** Writes one cell-format XF record (fStyle=0): ifnt/ifmt as given, ixfParent pointing at the Normal cell-style XF (index 0), a CellXF payload carrying `alignment`/`verticalAlignment`/`decoration`'s own fields -- general alignment, bottom vertical alignment, and no fill/border (the same bytes this always wrote before either existed) for whatever is omitted. Twenty bytes total ([MS-XLS] 2.4.353). */
|
package/dist/biff/xf-writer.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E as XfDecorationFields } from "../xf-colors-
|
|
1
|
+
import { E as XfDecorationFields } from "../xf-colors-kdNsiNYt.js";
|
|
2
2
|
import { Alignment, Color } from "document-schema.js";
|
|
3
3
|
//#region src/biff/xf-writer.d.ts
|
|
4
4
|
/** Writes one cell-format XF record (fStyle=0): ifnt/ifmt as given, ixfParent pointing at the Normal cell-style XF (index 0), a CellXF payload carrying `alignment`/`verticalAlignment`/`decoration`'s own fields -- general alignment, bottom vertical alignment, and no fill/border (the same bytes this always wrote before either existed) for whatever is omitted. Twenty bytes total ([MS-XLS] 2.4.353). */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as FormulaSheetContext } from "./ptg-
|
|
1
|
+
import { r as FormulaSheetContext } from "./ptg-75v7MhaA.js";
|
|
2
2
|
import { t as RecordGroup } from "./substreams-CgTHx5kX.js";
|
|
3
|
-
import {
|
|
3
|
+
import { a as RawConditionalFormatStyle } from "./conditional-format-BRMUTRP1.js";
|
|
4
4
|
import { Color, ContentSheetConditionalFormat, ContentSheetConditionalFormatValue, ContentSheetRange } from "document-schema.js";
|
|
5
5
|
//#region src/workbook/conditional-format-12.d.ts
|
|
6
6
|
type RawCfColor = {
|
|
@@ -65,7 +65,12 @@ interface RawTimePeriodFormat extends RawFilterFormatCommon {
|
|
|
65
65
|
interface RawSimpleFilterFormat extends RawFilterFormatCommon {
|
|
66
66
|
readonly kind: "containsBlanks" | "notContainsBlanks" | "containsErrors" | "notContainsErrors" | "uniqueValues" | "duplicateValues";
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
interface RawTextFilterFormat extends RawFilterFormatCommon {
|
|
69
|
+
readonly kind: "containsText" | "notContainsText" | "beginsWith" | "endsWith";
|
|
70
|
+
readonly text: string;
|
|
71
|
+
}
|
|
72
|
+
type RawConditionalFormat12 = RawColorScaleFormat | RawDataBarFormat | RawIconSetFormat | RawTop10Format | RawAboveAverageFormat | RawTimePeriodFormat | RawSimpleFilterFormat | RawTextFilterFormat;
|
|
73
|
+
declare function readCfTextFilterRule(icfTemplate: number, templateParams: Uint8Array<ArrayBuffer>, rgce1: Uint8Array<ArrayBuffer>, formulaSheets: FormulaSheetContext): Omit<RawTextFilterFormat, keyof RawFilterFormatCommon> | undefined;
|
|
69
74
|
interface CondFmt12GroupResult {
|
|
70
75
|
readonly formats: RawConditionalFormat12[];
|
|
71
76
|
/** How many records (the CondFmt12 itself plus every CF12 it claimed) the caller should advance past, regardless of how many rules actually promoted. */
|
|
@@ -73,4 +78,4 @@ interface CondFmt12GroupResult {
|
|
|
73
78
|
}
|
|
74
79
|
declare function readCondFmt12Group(records: readonly RecordGroup[], startIndex: number, formulaSheets: FormulaSheetContext): CondFmt12GroupResult;
|
|
75
80
|
//#endregion
|
|
76
|
-
export { RawConditionalFormat12 as a,
|
|
81
|
+
export { RawConditionalFormat12 as a, RawIconSetFormat as c, RawTimePeriod as d, RawTimePeriodFormat as f, readCondFmt12Group as h, RawColorScaleFormat as i, RawSimpleFilterFormat as l, readCfTextFilterRule as m, RawAboveAverageFormat as n, RawConditionalFormat12Common as o, RawTop10Format as p, RawCfColor as r, RawDataBarFormat as s, CondFmt12GroupResult as t, RawTextFilterFormat as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as FormulaSheetContext } from "./ptg-
|
|
1
|
+
import { r as FormulaSheetContext } from "./ptg-75v7MhaA.cjs";
|
|
2
2
|
import { t as RecordGroup } from "./substreams-XDNgDvRJ.cjs";
|
|
3
|
-
import {
|
|
3
|
+
import { a as RawConditionalFormatStyle } from "./conditional-format-Cth_afMy.cjs";
|
|
4
4
|
import { Color, ContentSheetConditionalFormat, ContentSheetConditionalFormatValue, ContentSheetRange } from "document-schema.js";
|
|
5
5
|
//#region src/workbook/conditional-format-12.d.ts
|
|
6
6
|
type RawCfColor = {
|
|
@@ -65,7 +65,12 @@ interface RawTimePeriodFormat extends RawFilterFormatCommon {
|
|
|
65
65
|
interface RawSimpleFilterFormat extends RawFilterFormatCommon {
|
|
66
66
|
readonly kind: "containsBlanks" | "notContainsBlanks" | "containsErrors" | "notContainsErrors" | "uniqueValues" | "duplicateValues";
|
|
67
67
|
}
|
|
68
|
-
|
|
68
|
+
interface RawTextFilterFormat extends RawFilterFormatCommon {
|
|
69
|
+
readonly kind: "containsText" | "notContainsText" | "beginsWith" | "endsWith";
|
|
70
|
+
readonly text: string;
|
|
71
|
+
}
|
|
72
|
+
type RawConditionalFormat12 = RawColorScaleFormat | RawDataBarFormat | RawIconSetFormat | RawTop10Format | RawAboveAverageFormat | RawTimePeriodFormat | RawSimpleFilterFormat | RawTextFilterFormat;
|
|
73
|
+
declare function readCfTextFilterRule(icfTemplate: number, templateParams: Uint8Array<ArrayBuffer>, rgce1: Uint8Array<ArrayBuffer>, formulaSheets: FormulaSheetContext): Omit<RawTextFilterFormat, keyof RawFilterFormatCommon> | undefined;
|
|
69
74
|
interface CondFmt12GroupResult {
|
|
70
75
|
readonly formats: RawConditionalFormat12[];
|
|
71
76
|
/** How many records (the CondFmt12 itself plus every CF12 it claimed) the caller should advance past, regardless of how many rules actually promoted. */
|
|
@@ -73,4 +78,4 @@ interface CondFmt12GroupResult {
|
|
|
73
78
|
}
|
|
74
79
|
declare function readCondFmt12Group(records: readonly RecordGroup[], startIndex: number, formulaSheets: FormulaSheetContext): CondFmt12GroupResult;
|
|
75
80
|
//#endregion
|
|
76
|
-
export { RawConditionalFormat12 as a,
|
|
81
|
+
export { RawConditionalFormat12 as a, RawIconSetFormat as c, RawTimePeriod as d, RawTimePeriodFormat as f, readCondFmt12Group as h, RawColorScaleFormat as i, RawSimpleFilterFormat as l, readCfTextFilterRule as m, RawAboveAverageFormat as n, RawConditionalFormat12Common as o, RawTop10Format as p, RawCfColor as r, RawDataBarFormat as s, CondFmt12GroupResult as t, RawTextFilterFormat as u };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { r as FormulaSheetContext } from "./ptg-75v7MhaA.js";
|
|
2
|
+
import { t as RecordGroup } from "./substreams-CgTHx5kX.js";
|
|
3
|
+
import { ContentSheetRange, SheetRuleOperator } from "document-schema.js";
|
|
4
|
+
//#region src/workbook/conditional-format.d.ts
|
|
5
|
+
interface RawConditionalFormatFill {
|
|
6
|
+
readonly fillPattern: number;
|
|
7
|
+
readonly fillForegroundIcv: number;
|
|
8
|
+
readonly fillBackgroundIcv: number;
|
|
9
|
+
}
|
|
10
|
+
interface RawConditionalFormatStyle {
|
|
11
|
+
readonly fontColorIcv: number | undefined;
|
|
12
|
+
readonly fill: RawConditionalFormatFill | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface RawConditionalFormat {
|
|
15
|
+
readonly operator: SheetRuleOperator;
|
|
16
|
+
readonly formula1: string;
|
|
17
|
+
readonly formula2: string | undefined;
|
|
18
|
+
readonly style: RawConditionalFormatStyle | undefined;
|
|
19
|
+
readonly ranges: ContentSheetRange[];
|
|
20
|
+
}
|
|
21
|
+
declare function parseDxfStyle(dxfBytes: Uint8Array<ArrayBuffer>): RawConditionalFormatStyle | undefined;
|
|
22
|
+
/** A CF record's own operand, in its rawest usable form -- the pieces conditional-format-ex.ts needs to resolve a CFEx that extends this specific CF (by icf, a positional index into a CondFmt's own CF children), independent of whether readCf below can promote this CF into a 'cellIs' rule at all. A ct 0x02 formula condition, exactly the kind readCf itself never promotes, is the one CFEx actually cares about (see conditional-format-ex.ts's own top comment for why). */
|
|
23
|
+
interface RawCfOperand {
|
|
24
|
+
readonly ct: number;
|
|
25
|
+
readonly cp: number;
|
|
26
|
+
readonly rgce1: Uint8Array<ArrayBuffer>;
|
|
27
|
+
}
|
|
28
|
+
interface CondFmtGroupResult {
|
|
29
|
+
readonly formats: RawConditionalFormat[];
|
|
30
|
+
/** How many records (the CondFmt itself plus every CF it claimed) the caller should advance past, regardless of how many rules actually promoted. */
|
|
31
|
+
readonly recordsConsumed: number;
|
|
32
|
+
/** CondFmt's own nID ([MS-XLS] 2.5.56's own CondFmtStructure) -- the identifier a later CFEx record's own nID field cross-references to extend one specific CF child of this group (conditional-format-ex.ts). 0 on a malformed group, alongside an empty rawCfs -- a real CFEx can legitimately name nID 0, but never resolves anything through an empty rawCfs, so the two degraded groups can never be confused for one another by a lookup. */
|
|
33
|
+
readonly nID: number;
|
|
34
|
+
/** This group's own shared ranges, exposed independently of `formats` since a CFEx-promoted rule needs them too and a CF this reader could not promote into `formats` still shares them. */
|
|
35
|
+
readonly ranges: ContentSheetRange[];
|
|
36
|
+
/** Every one of this group's CF children, in declared (icf) order, each parsed to its raw operand or undefined for one this reader could not even parse -- CFExNonCF12's own icf field indexes into exactly this collection, regardless of which entries readCf itself went on to promote into `formats`. */
|
|
37
|
+
readonly rawCfs: readonly (RawCfOperand | undefined)[];
|
|
38
|
+
}
|
|
39
|
+
declare function readCondFmtGroup(records: readonly RecordGroup[], startIndex: number, formulaSheets: FormulaSheetContext): CondFmtGroupResult;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { RawConditionalFormatStyle as a, RawConditionalFormatFill as i, RawCfOperand as n, parseDxfStyle as o, RawConditionalFormat as r, readCondFmtGroup as s, CondFmtGroupResult as t };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { r as FormulaSheetContext } from "./ptg-75v7MhaA.cjs";
|
|
2
|
+
import { t as RecordGroup } from "./substreams-XDNgDvRJ.cjs";
|
|
3
|
+
import { ContentSheetRange, SheetRuleOperator } from "document-schema.js";
|
|
4
|
+
//#region src/workbook/conditional-format.d.ts
|
|
5
|
+
interface RawConditionalFormatFill {
|
|
6
|
+
readonly fillPattern: number;
|
|
7
|
+
readonly fillForegroundIcv: number;
|
|
8
|
+
readonly fillBackgroundIcv: number;
|
|
9
|
+
}
|
|
10
|
+
interface RawConditionalFormatStyle {
|
|
11
|
+
readonly fontColorIcv: number | undefined;
|
|
12
|
+
readonly fill: RawConditionalFormatFill | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface RawConditionalFormat {
|
|
15
|
+
readonly operator: SheetRuleOperator;
|
|
16
|
+
readonly formula1: string;
|
|
17
|
+
readonly formula2: string | undefined;
|
|
18
|
+
readonly style: RawConditionalFormatStyle | undefined;
|
|
19
|
+
readonly ranges: ContentSheetRange[];
|
|
20
|
+
}
|
|
21
|
+
declare function parseDxfStyle(dxfBytes: Uint8Array<ArrayBuffer>): RawConditionalFormatStyle | undefined;
|
|
22
|
+
/** A CF record's own operand, in its rawest usable form -- the pieces conditional-format-ex.ts needs to resolve a CFEx that extends this specific CF (by icf, a positional index into a CondFmt's own CF children), independent of whether readCf below can promote this CF into a 'cellIs' rule at all. A ct 0x02 formula condition, exactly the kind readCf itself never promotes, is the one CFEx actually cares about (see conditional-format-ex.ts's own top comment for why). */
|
|
23
|
+
interface RawCfOperand {
|
|
24
|
+
readonly ct: number;
|
|
25
|
+
readonly cp: number;
|
|
26
|
+
readonly rgce1: Uint8Array<ArrayBuffer>;
|
|
27
|
+
}
|
|
28
|
+
interface CondFmtGroupResult {
|
|
29
|
+
readonly formats: RawConditionalFormat[];
|
|
30
|
+
/** How many records (the CondFmt itself plus every CF it claimed) the caller should advance past, regardless of how many rules actually promoted. */
|
|
31
|
+
readonly recordsConsumed: number;
|
|
32
|
+
/** CondFmt's own nID ([MS-XLS] 2.5.56's own CondFmtStructure) -- the identifier a later CFEx record's own nID field cross-references to extend one specific CF child of this group (conditional-format-ex.ts). 0 on a malformed group, alongside an empty rawCfs -- a real CFEx can legitimately name nID 0, but never resolves anything through an empty rawCfs, so the two degraded groups can never be confused for one another by a lookup. */
|
|
33
|
+
readonly nID: number;
|
|
34
|
+
/** This group's own shared ranges, exposed independently of `formats` since a CFEx-promoted rule needs them too and a CF this reader could not promote into `formats` still shares them. */
|
|
35
|
+
readonly ranges: ContentSheetRange[];
|
|
36
|
+
/** Every one of this group's CF children, in declared (icf) order, each parsed to its raw operand or undefined for one this reader could not even parse -- CFExNonCF12's own icf field indexes into exactly this collection, regardless of which entries readCf itself went on to promote into `formats`. */
|
|
37
|
+
readonly rawCfs: readonly (RawCfOperand | undefined)[];
|
|
38
|
+
}
|
|
39
|
+
declare function readCondFmtGroup(records: readonly RecordGroup[], startIndex: number, formulaSheets: FormulaSheetContext): CondFmtGroupResult;
|
|
40
|
+
//#endregion
|
|
41
|
+
export { RawConditionalFormatStyle as a, RawConditionalFormatFill as i, RawCfOperand as n, parseDxfStyle as o, RawConditionalFormat as r, readCondFmtGroup as s, CondFmtGroupResult as t };
|
package/dist/content.cjs
CHANGED
|
@@ -83,7 +83,7 @@ function mapPrintSettings(raw, names) {
|
|
|
83
83
|
/**
|
|
84
84
|
* Reads a .xls file's bytes into a ContentDocument.
|
|
85
85
|
*
|
|
86
|
-
* The counterpart of ooxml.js's readXlsxContent, producing the same shape from the older format. `password` decrypts a workbook protected by [MS-XLS] 2.4.117's FilePass record under the [MS-OFFCRYPTO] 2.3.6.1 RC4 encryption header scheme -- see workbook/encryption.ts. It is ignored for an unencrypted workbook, and a missing or incorrect password against an encrypted one throws rather than returning a partial or garbled document.
|
|
86
|
+
* The counterpart of ooxml.js's readXlsxContent, producing the same shape from the older format. `password` decrypts a workbook protected by [MS-XLS] 2.4.117's FilePass record, under either the [MS-OFFCRYPTO] 2.3.6.1 RC4 encryption header scheme or 2.3.7's XOR obfuscation -- see workbook/encryption.ts. It is ignored for an unencrypted workbook, and a missing or incorrect password against an encrypted one throws rather than returning a partial or garbled document.
|
|
87
87
|
*/
|
|
88
88
|
function readXlsContent(bytes, password) {
|
|
89
89
|
const { workbook, metadata } = require_container.readWorkbookStreams(bytes);
|
|
@@ -256,6 +256,16 @@ function mapConditionalFormats12(raw, palette) {
|
|
|
256
256
|
});
|
|
257
257
|
continue;
|
|
258
258
|
}
|
|
259
|
+
if (format.kind === "containsText" || format.kind === "notContainsText" || format.kind === "beginsWith" || format.kind === "endsWith") {
|
|
260
|
+
const style = mapConditionalFormatStyle(format.style, palette);
|
|
261
|
+
results.push({
|
|
262
|
+
type: format.kind,
|
|
263
|
+
text: format.text,
|
|
264
|
+
...style !== void 0 ? { style } : {},
|
|
265
|
+
...common
|
|
266
|
+
});
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
259
269
|
const style = mapConditionalFormatStyle(format.style, palette);
|
|
260
270
|
results.push({
|
|
261
271
|
type: format.kind,
|
package/dist/content.d.cts
CHANGED
|
@@ -11,7 +11,7 @@ type XlsContentDocument = Extract<ContentDocument, {
|
|
|
11
11
|
/**
|
|
12
12
|
* Reads a .xls file's bytes into a ContentDocument.
|
|
13
13
|
*
|
|
14
|
-
* The counterpart of ooxml.js's readXlsxContent, producing the same shape from the older format. `password` decrypts a workbook protected by [MS-XLS] 2.4.117's FilePass record under the [MS-OFFCRYPTO] 2.3.6.1 RC4 encryption header scheme -- see workbook/encryption.ts. It is ignored for an unencrypted workbook, and a missing or incorrect password against an encrypted one throws rather than returning a partial or garbled document.
|
|
14
|
+
* The counterpart of ooxml.js's readXlsxContent, producing the same shape from the older format. `password` decrypts a workbook protected by [MS-XLS] 2.4.117's FilePass record, under either the [MS-OFFCRYPTO] 2.3.6.1 RC4 encryption header scheme or 2.3.7's XOR obfuscation -- see workbook/encryption.ts. It is ignored for an unencrypted workbook, and a missing or incorrect password against an encrypted one throws rather than returning a partial or garbled document.
|
|
15
15
|
*/
|
|
16
16
|
declare function readXlsContent(bytes: Uint8Array<ArrayBuffer>, password?: string): XlsContentDocument;
|
|
17
17
|
/** The tree-form read: readXlsContent composed with the schema's own structural transform, exactly as ooxml.js's readXlsx wraps readXlsxContent. */
|
package/dist/content.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ type XlsContentDocument = Extract<ContentDocument, {
|
|
|
11
11
|
/**
|
|
12
12
|
* Reads a .xls file's bytes into a ContentDocument.
|
|
13
13
|
*
|
|
14
|
-
* The counterpart of ooxml.js's readXlsxContent, producing the same shape from the older format. `password` decrypts a workbook protected by [MS-XLS] 2.4.117's FilePass record under the [MS-OFFCRYPTO] 2.3.6.1 RC4 encryption header scheme -- see workbook/encryption.ts. It is ignored for an unencrypted workbook, and a missing or incorrect password against an encrypted one throws rather than returning a partial or garbled document.
|
|
14
|
+
* The counterpart of ooxml.js's readXlsxContent, producing the same shape from the older format. `password` decrypts a workbook protected by [MS-XLS] 2.4.117's FilePass record, under either the [MS-OFFCRYPTO] 2.3.6.1 RC4 encryption header scheme or 2.3.7's XOR obfuscation -- see workbook/encryption.ts. It is ignored for an unencrypted workbook, and a missing or incorrect password against an encrypted one throws rather than returning a partial or garbled document.
|
|
15
15
|
*/
|
|
16
16
|
declare function readXlsContent(bytes: Uint8Array<ArrayBuffer>, password?: string): XlsContentDocument;
|
|
17
17
|
/** The tree-form read: readXlsContent composed with the schema's own structural transform, exactly as ooxml.js's readXlsx wraps readXlsxContent. */
|