javascript-excel 2.5.0 → 2.6.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 +1 -1
- package/dist/csv.d.cts +1 -1
- package/dist/csv.d.ts +1 -1
- package/dist/dom.d.cts +1 -1
- package/dist/dom.d.ts +1 -1
- package/dist/import.cjs +1 -1
- package/dist/import.d.cts +2 -2
- package/dist/import.d.ts +2 -2
- package/dist/import.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/{pipeline-1AVJbbqT.js → pipeline-BRzRd5v3.js} +1 -1
- package/dist/{pipeline-DVgO1aGC.d.ts → pipeline-BY-SiQWW.d.ts} +1 -1
- package/dist/{pipeline-C9zhwGAV.cjs → pipeline-C13EIWHJ.cjs} +1 -1
- package/dist/{pipeline-CJWE3NWg.d.cts → pipeline-C7R86kQg.d.cts} +1 -1
- package/dist/{read-B6tY0ooT.js → read-CrI550TK.js} +84 -2
- package/dist/{read-Dgw9kMzh.cjs → read-X1KxggZ7.cjs} +84 -2
- package/dist/read.cjs +1 -1
- package/dist/read.d.cts +2 -2
- package/dist/read.d.ts +2 -2
- package/dist/read.js +1 -1
- package/dist/{warnings-DEsTp6rd.d.cts → warnings-Bphby2c7.d.cts} +18 -3
- package/dist/{warnings-DEsTp6rd.d.ts → warnings-Bphby2c7.d.ts} +18 -3
- package/dist/worker.cjs +2 -2
- package/dist/worker.d.cts +3 -3
- package/dist/worker.d.ts +3 -3
- package/dist/worker.js +2 -2
- package/dist/{write-JvXRv63d.d.cts → write-BbV7BlbS.d.cts} +1 -1
- package/dist/{write-BylKqAmD.d.ts → write-DryxCc2Q.d.ts} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,7 +91,7 @@ const cell = exact.workbook.sheets[0]?.rows[0]?.[0];
|
|
|
91
91
|
console.log(cell?.type, cell?.value, cell?.rawText); // "number" 50.3 "50.30"
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
-
Damage the reader can recover from comes back as `warnings`. `isDataLossWarning(w)` tells the ones where data was lost (a cell skipped, rows cut, a part missing, comments or charts not read; `partKind` names the part, including ActiveX controls, embedded files, customUI, web add-ins
|
|
94
|
+
Damage the reader can recover from comes back as `warnings`. `isDataLossWarning(w)` tells the ones where data was lost (a cell skipped, rows cut, a part missing, comments or charts not read; `partKind` names the part, including ActiveX controls, embedded files, customUI, web add-ins, parts no relationship reaches and relationships to targets outside the file such as linked pictures, wherever they sit in the package) from informational ones; the warning cap (`limits.maxWarnings`, default 1,000) drops only informational warnings, so filtering `warnings` with it is enough to refuse a damaged file.
|
|
95
95
|
|
|
96
96
|
To accept or refuse an upload without reading it into the model, `inspect(file, { limits, signal })` checks it part by part without building cells: it refuses every file `read` refuses under the same limits, with the same error, and returns the format, the worksheets with their cell counts, and the part kinds `read` reports (`partKinds`: VBA, external links, OLE objects, …). It also inflates the parts `read` never opens, searches the bytes of every one of them for `<!DOCTYPE` (ASCII-compatible, UTF-16 and UTF-32 forms, whatever the part's name; a declaration inside an XML comment or in an embedded file is refused too), and refuses XML parts whose byte order mark, first bytes or complete declaration show an encoding other than UTF-8 or UTF-16, or whose declaration is malformed or not at the very start. Set `limits.maxItems` (for example 100,000): it bounds the styles and defined names `inspect` still holds, and the shared-formula masters and reference records it keeps. See [docs/api.md §5.2.1](https://github.com/securedeveloper/javascript-excel/blob/main/docs/api.md#521-inspect-inspect-added-in-25).
|
|
97
97
|
|
package/dist/csv.d.cts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @module javascript-excel/csv
|
|
10
10
|
*/
|
|
11
|
-
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-
|
|
11
|
+
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-Bphby2c7.cjs";
|
|
12
12
|
import { D as Sheet, T as RichTextRun, a as Cell, c as CellType, h as ErrorCode, j as Workbook, l as CellValue, o as CellErrorValue, s as CellInput, w as RichText } from "./model-BUNp7B0Z.cjs";
|
|
13
13
|
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.cjs";
|
|
14
14
|
/** Options for `parseCsv` and `readCsv`. */
|
package/dist/csv.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*
|
|
9
9
|
* @module javascript-excel/csv
|
|
10
10
|
*/
|
|
11
|
-
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-
|
|
11
|
+
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-Bphby2c7.js";
|
|
12
12
|
import { D as Sheet, T as RichTextRun, a as Cell, c as CellType, h as ErrorCode, j as Workbook, l as CellValue, o as CellErrorValue, s as CellInput, w as RichText } from "./model-BUNp7B0Z.js";
|
|
13
13
|
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.js";
|
|
14
14
|
/** Options for `parseCsv` and `readCsv`. */
|
package/dist/dom.d.cts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @module javascript-excel/dom
|
|
9
9
|
*/
|
|
10
10
|
import { t as AutoWidthOptions } from "./auto-width-DZvQSucm.cjs";
|
|
11
|
-
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, r as ExcelWarning, t as DroppedWarnings } from "./warnings-
|
|
11
|
+
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, r as ExcelWarning, t as DroppedWarnings } from "./warnings-Bphby2c7.cjs";
|
|
12
12
|
import { D as Sheet, k as Style, s as CellInput } from "./model-BUNp7B0Z.cjs";
|
|
13
13
|
/** `HTMLTableElement` when the consumer has DOM types, else `object`. */
|
|
14
14
|
export type TableElement = typeof globalThis extends {
|
package/dist/dom.d.ts
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @module javascript-excel/dom
|
|
9
9
|
*/
|
|
10
10
|
import { t as AutoWidthOptions } from "./auto-width-CT-BihTW.js";
|
|
11
|
-
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, r as ExcelWarning, t as DroppedWarnings } from "./warnings-
|
|
11
|
+
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, r as ExcelWarning, t as DroppedWarnings } from "./warnings-Bphby2c7.js";
|
|
12
12
|
import { D as Sheet, k as Style, s as CellInput } from "./model-BUNp7B0Z.js";
|
|
13
13
|
/** `HTMLTableElement` when the consumer has DOM types, else `object`. */
|
|
14
14
|
export type TableElement = typeof globalThis extends {
|
package/dist/import.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_pipeline = require("./pipeline-
|
|
2
|
+
const require_pipeline = require("./pipeline-C13EIWHJ.cjs");
|
|
3
3
|
const require_warnings = require("./warnings-CJPiDqei.cjs");
|
|
4
4
|
exports.applyMapping = require_pipeline.applyMapping;
|
|
5
5
|
exports.coerceColumns = require_pipeline.coerceColumns;
|
package/dist/import.d.cts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* (docs/api.md §5.6). Header detection, type inference, locale-aware
|
|
4
4
|
* parsing and column mapping, plus the `importDataset` pipeline.
|
|
5
5
|
*/
|
|
6
|
-
import { A as NumberGroup, C as coerceColumns, D as ImportLocale, E as HeaderDetection, M as parseNumber, O as detectHeader, S as TypeOptions, T as DetectHeaderOptions, _ as ColumnType, a as ImportProgress, b as ImportIssueCode, c as FieldSpec, d as MappableDataset, f as MappedDataset, g as CoerceResult, h as mapColumns, i as ImportMeta, j as parseDate, k as DateOrder, l as ImportSchema, m as applyMapping, n as ImportDatasetOptions, o as importDataset, p as MappingResult, r as ImportDatasetResult, s as ColumnMapping, t as DroppedIssues, u as ImportedColumn, v as DatasetLike, w as inferColumnTypes, x as InferredColumn, y as ImportIssue } from "./pipeline-
|
|
7
|
-
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-
|
|
6
|
+
import { A as NumberGroup, C as coerceColumns, D as ImportLocale, E as HeaderDetection, M as parseNumber, O as detectHeader, S as TypeOptions, T as DetectHeaderOptions, _ as ColumnType, a as ImportProgress, b as ImportIssueCode, c as FieldSpec, d as MappableDataset, f as MappedDataset, g as CoerceResult, h as mapColumns, i as ImportMeta, j as parseDate, k as DateOrder, l as ImportSchema, m as applyMapping, n as ImportDatasetOptions, o as importDataset, p as MappingResult, r as ImportDatasetResult, s as ColumnMapping, t as DroppedIssues, u as ImportedColumn, v as DatasetLike, w as inferColumnTypes, x as InferredColumn, y as ImportIssue } from "./pipeline-C7R86kQg.cjs";
|
|
7
|
+
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-Bphby2c7.cjs";
|
|
8
8
|
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.cjs";
|
|
9
9
|
import { ReadLimits, SheetInfo } from "./read.cjs";
|
|
10
10
|
export { type AbortSignalLike, type BinaryInput, type BlobLike, type BlobType, type CoerceResult, type ColumnMapping, type ColumnType, type DatasetLike, type DateOrder, type DetectHeaderOptions, type DroppedIssues, type DroppedWarnings, type ExcelPartKind, type ExcelWarning, type ExcelWarningCode, type FieldSpec, type HeaderDetection, type ImportDatasetOptions, type ImportDatasetResult, type ImportIssue, type ImportIssueCode, type ImportLocale, type ImportMeta, type ImportProgress, type ImportSchema, type ImportedColumn, type InferredColumn, type MappableDataset, type MappedDataset, type MappingResult, type NumberGroup, type ReadLimits, type SheetInfo, type TypeOptions, applyMapping, coerceColumns, detectHeader, importDataset, inferColumnTypes, isDataLossWarning, mapColumns, parseDate, parseNumber };
|
package/dist/import.d.ts
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* (docs/api.md §5.6). Header detection, type inference, locale-aware
|
|
4
4
|
* parsing and column mapping, plus the `importDataset` pipeline.
|
|
5
5
|
*/
|
|
6
|
-
import { A as NumberGroup, C as coerceColumns, D as ImportLocale, E as HeaderDetection, M as parseNumber, O as detectHeader, S as TypeOptions, T as DetectHeaderOptions, _ as ColumnType, a as ImportProgress, b as ImportIssueCode, c as FieldSpec, d as MappableDataset, f as MappedDataset, g as CoerceResult, h as mapColumns, i as ImportMeta, j as parseDate, k as DateOrder, l as ImportSchema, m as applyMapping, n as ImportDatasetOptions, o as importDataset, p as MappingResult, r as ImportDatasetResult, s as ColumnMapping, t as DroppedIssues, u as ImportedColumn, v as DatasetLike, w as inferColumnTypes, x as InferredColumn, y as ImportIssue } from "./pipeline-
|
|
7
|
-
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-
|
|
6
|
+
import { A as NumberGroup, C as coerceColumns, D as ImportLocale, E as HeaderDetection, M as parseNumber, O as detectHeader, S as TypeOptions, T as DetectHeaderOptions, _ as ColumnType, a as ImportProgress, b as ImportIssueCode, c as FieldSpec, d as MappableDataset, f as MappedDataset, g as CoerceResult, h as mapColumns, i as ImportMeta, j as parseDate, k as DateOrder, l as ImportSchema, m as applyMapping, n as ImportDatasetOptions, o as importDataset, p as MappingResult, r as ImportDatasetResult, s as ColumnMapping, t as DroppedIssues, u as ImportedColumn, v as DatasetLike, w as inferColumnTypes, x as InferredColumn, y as ImportIssue } from "./pipeline-BY-SiQWW.js";
|
|
7
|
+
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-Bphby2c7.js";
|
|
8
8
|
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.js";
|
|
9
9
|
import { ReadLimits, SheetInfo } from "./read.js";
|
|
10
10
|
export { type AbortSignalLike, type BinaryInput, type BlobLike, type BlobType, type CoerceResult, type ColumnMapping, type ColumnType, type DatasetLike, type DateOrder, type DetectHeaderOptions, type DroppedIssues, type DroppedWarnings, type ExcelPartKind, type ExcelWarning, type ExcelWarningCode, type FieldSpec, type HeaderDetection, type ImportDatasetOptions, type ImportDatasetResult, type ImportIssue, type ImportIssueCode, type ImportLocale, type ImportMeta, type ImportProgress, type ImportSchema, type ImportedColumn, type InferredColumn, type MappableDataset, type MappedDataset, type MappingResult, type NumberGroup, type ReadLimits, type SheetInfo, type TypeOptions, applyMapping, coerceColumns, detectHeader, importDataset, inferColumnTypes, isDataLossWarning, mapColumns, parseDate, parseNumber };
|
package/dist/import.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as mapColumns, c as parseNumber, i as applyMapping, n as coerceColumns, o as detectHeader, r as inferColumnTypes, s as parseDate, t as importDataset } from "./pipeline-
|
|
1
|
+
import { a as mapColumns, c as parseNumber, i as applyMapping, n as coerceColumns, o as detectHeader, r as inferColumnTypes, s as parseDate, t as importDataset } from "./pipeline-BRzRd5v3.js";
|
|
2
2
|
import { t as isDataLossWarning } from "./warnings-BPz1Ia3s.js";
|
|
3
3
|
export { applyMapping, coerceColumns, detectHeader, importDataset, inferColumnTypes, isDataLossWarning, mapColumns, parseDate, parseNumber };
|
package/dist/index.cjs
CHANGED
|
@@ -11,7 +11,7 @@ const require_numfmt = require("./numfmt-DwsnhZKe.cjs");
|
|
|
11
11
|
const require_address = require("./address-DKd_3EGf.cjs");
|
|
12
12
|
// src/index.ts
|
|
13
13
|
/** Package version. Set from package.json by `npm run version-packages` (scripts/sync-version.mjs); a unit test checks it. */
|
|
14
|
-
const VERSION = "2.
|
|
14
|
+
const VERSION = "2.6.0";
|
|
15
15
|
exports.BUILTIN_NUM_FMTS = require_numfmt.BUILTIN_NUM_FMTS;
|
|
16
16
|
exports.CsvError = require_errors.CsvError;
|
|
17
17
|
exports.EnvironmentError = require_errors.EnvironmentError;
|
package/dist/index.d.cts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* @module javascript-excel
|
|
9
9
|
*/
|
|
10
10
|
import { A as Theme, C as PrintSetup, D as Sheet, E as RowProps, O as SheetView, S as PatternType, T as RichTextRun, _ as Font, a as Cell, b as NumFmt, c as CellType, d as ColumnProps, f as ColumnWidth, g as Fill, h as ErrorCode, i as BorderStyle, j as Workbook, k as Style, l as CellValue, m as DocProperties, n as Border, o as CellErrorValue, p as DefinedName, r as BorderSide, s as CellInput, t as Alignment, u as Color, v as GradientFill, w as RichText, x as PatternFill, y as Hyperlink } from "./model-BUNp7B0Z.cjs";
|
|
11
|
-
import { a as toUint8Array, i as toBlob, n as WriteOptions, r as XLSX_MIME, t as Progress } from "./write-
|
|
12
|
-
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-
|
|
11
|
+
import { a as toUint8Array, i as toBlob, n as WriteOptions, r as XLSX_MIME, t as Progress } from "./write-BbV7BlbS.cjs";
|
|
12
|
+
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-Bphby2c7.cjs";
|
|
13
13
|
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.cjs";
|
|
14
14
|
import { t as AutoWidthOptions } from "./auto-width-DZvQSucm.cjs";
|
|
15
15
|
/**
|
|
@@ -293,5 +293,5 @@ export declare function encodeRange(r: RangeAddress): string;
|
|
|
293
293
|
/** 'A1:C3' or 'A1' → range, normalised so start is top-left. */
|
|
294
294
|
export declare function decodeRange(ref: string): RangeAddress;
|
|
295
295
|
/** Package version. Set from package.json by `npm run version-packages` (scripts/sync-version.mjs); a unit test checks it. */
|
|
296
|
-
export declare const VERSION = "2.
|
|
296
|
+
export declare const VERSION = "2.6.0";
|
|
297
297
|
export { type AbortSignalLike, type Alignment, type AutoWidthOptions, type BinaryInput, type BlobLike, type BlobType, type Border, type BorderSide, type BorderStyle, type Cell, type CellAddress, type CellErrorValue, type CellInput, type CellTextOptions, type CellType, type CellValue, type Color, type ColorContext, type ColumnDef, type ColumnProps, type ColumnTotal, type ColumnWidth, type Dataset, type DatasetBlock, type DatasetOptions, type DatasetResult, type DateOptions, type DefinedName, type DocProperties, type DroppedWarnings, type ErrorCode, type ExcelErrorCode, type ExcelErrorOptions, type ExcelPartKind, type ExcelWarning, type ExcelWarningCode, type Fill, type Font, type GradientFill, type GroupColumn, type Hyperlink, type LeafColumn, type NumFmt, type PatternFill, type PatternType, type PrintSetup, type Progress, type RangeAddress, type RichText, type RichTextRun, type RowProps, type Sheet, type SheetNameProblem, type SheetView, type Style, type Theme, type ToDatasetOptions, type Workbook, type WriteOptions, XLSX_MIME, isDataLossWarning, toBlob, toUint8Array };
|
package/dist/index.d.ts
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* @module javascript-excel
|
|
9
9
|
*/
|
|
10
10
|
import { A as Theme, C as PrintSetup, D as Sheet, E as RowProps, O as SheetView, S as PatternType, T as RichTextRun, _ as Font, a as Cell, b as NumFmt, c as CellType, d as ColumnProps, f as ColumnWidth, g as Fill, h as ErrorCode, i as BorderStyle, j as Workbook, k as Style, l as CellValue, m as DocProperties, n as Border, o as CellErrorValue, p as DefinedName, r as BorderSide, s as CellInput, t as Alignment, u as Color, v as GradientFill, w as RichText, x as PatternFill, y as Hyperlink } from "./model-BUNp7B0Z.js";
|
|
11
|
-
import { a as toUint8Array, i as toBlob, n as WriteOptions, r as XLSX_MIME, t as Progress } from "./write-
|
|
12
|
-
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-
|
|
11
|
+
import { a as toUint8Array, i as toBlob, n as WriteOptions, r as XLSX_MIME, t as Progress } from "./write-DryxCc2Q.js";
|
|
12
|
+
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-Bphby2c7.js";
|
|
13
13
|
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.js";
|
|
14
14
|
import { t as AutoWidthOptions } from "./auto-width-CT-BihTW.js";
|
|
15
15
|
/**
|
|
@@ -293,5 +293,5 @@ export declare function encodeRange(r: RangeAddress): string;
|
|
|
293
293
|
/** 'A1:C3' or 'A1' → range, normalised so start is top-left. */
|
|
294
294
|
export declare function decodeRange(ref: string): RangeAddress;
|
|
295
295
|
/** Package version. Set from package.json by `npm run version-packages` (scripts/sync-version.mjs); a unit test checks it. */
|
|
296
|
-
export declare const VERSION = "2.
|
|
296
|
+
export declare const VERSION = "2.6.0";
|
|
297
297
|
export { type AbortSignalLike, type Alignment, type AutoWidthOptions, type BinaryInput, type BlobLike, type BlobType, type Border, type BorderSide, type BorderStyle, type Cell, type CellAddress, type CellErrorValue, type CellInput, type CellTextOptions, type CellType, type CellValue, type Color, type ColorContext, type ColumnDef, type ColumnProps, type ColumnTotal, type ColumnWidth, type Dataset, type DatasetBlock, type DatasetOptions, type DatasetResult, type DateOptions, type DefinedName, type DocProperties, type DroppedWarnings, type ErrorCode, type ExcelErrorCode, type ExcelErrorOptions, type ExcelPartKind, type ExcelWarning, type ExcelWarningCode, type Fill, type Font, type GradientFill, type GroupColumn, type Hyperlink, type LeafColumn, type NumFmt, type PatternFill, type PatternType, type PrintSetup, type Progress, type RangeAddress, type RichText, type RichTextRun, type RowProps, type Sheet, type SheetNameProblem, type SheetView, type Style, type Theme, type ToDatasetOptions, type Workbook, type WriteOptions, XLSX_MIME, isDataLossWarning, toBlob, toUint8Array };
|
package/dist/index.js
CHANGED
|
@@ -10,5 +10,5 @@ import { n as isDateFormat, t as BUILTIN_NUM_FMTS } from "./numfmt-Ci_oW11p.js";
|
|
|
10
10
|
import { a as decodeRange, c as encodeRange, i as decodeCol, n as MAX_ROWS, o as encodeCell, r as decodeCell, s as encodeCol, t as MAX_COLS } from "./address-BGH42dEg.js";
|
|
11
11
|
// src/index.ts
|
|
12
12
|
/** Package version. Set from package.json by `npm run version-packages` (scripts/sync-version.mjs); a unit test checks it. */
|
|
13
|
-
const VERSION = "2.
|
|
13
|
+
const VERSION = "2.6.0";
|
|
14
14
|
export { BUILTIN_NUM_FMTS, CsvError, EnvironmentError, ExcelError, FormatError, LimitError, MAX_COLS, MAX_ROWS, VERSION, ValidationError, XLSX_MIME, cellText, dateToSerial, decodeCell, decodeCol, decodeRange, encodeCell, encodeCol, encodeRange, fromDataset, fromDatasets, isDataLossWarning, isDateFormat, isExcelError, mergeStyles, resolveColor, sanitizeSheetName, serialToDate, toBlob, toDataset, toUint8Array, validateSheetName };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as readCsv } from "./csv-5jVhfM5l.js";
|
|
2
2
|
import { i as toDatasetDetailed } from "./dataset-Dh598YSG.js";
|
|
3
3
|
import { a as LimitError, i as FormatError, o as ValidationError } from "./errors-BQE62PFo.js";
|
|
4
|
-
import { a as readSheetNames, c as quoted, l as DEFAULT_LIMITS, n as detectFormat, o as readImpl, s as excerpt } from "./read-
|
|
4
|
+
import { a as readSheetNames, c as quoted, l as DEFAULT_LIMITS, n as detectFormat, o as readImpl, s as excerpt } from "./read-CrI550TK.js";
|
|
5
5
|
import { a as checkBlobSize, i as checkMaxWarnings, n as parseIsoDate, s as toBytes } from "./infer-DuSahY5i.js";
|
|
6
6
|
import { a as decodeRange } from "./address-BGH42dEg.js";
|
|
7
7
|
import { t as isoDate } from "./iso-date-CXnn-9mT.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as BinaryInput, r as ExcelWarning } from "./warnings-
|
|
1
|
+
import { o as BinaryInput, r as ExcelWarning } from "./warnings-Bphby2c7.js";
|
|
2
2
|
import { ReadLimits, SheetInfo } from "./read.js";
|
|
3
3
|
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.js";
|
|
4
4
|
import { D as Sheet, s as CellInput } from "./model-BUNp7B0Z.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_csv = require("./csv-BkVmMYQq.cjs");
|
|
2
2
|
const require_dataset = require("./dataset-B4-SEdCn.cjs");
|
|
3
3
|
const require_errors = require("./errors-CKYdpCoB.cjs");
|
|
4
|
-
const require_read = require("./read-
|
|
4
|
+
const require_read = require("./read-X1KxggZ7.cjs");
|
|
5
5
|
const require_infer = require("./infer-B950M3-F.cjs");
|
|
6
6
|
const require_address = require("./address-DKd_3EGf.cjs");
|
|
7
7
|
const require_iso_date = require("./iso-date-3TY1OlGd.cjs");
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { o as BinaryInput, r as ExcelWarning } from "./warnings-
|
|
1
|
+
import { o as BinaryInput, r as ExcelWarning } from "./warnings-Bphby2c7.cjs";
|
|
2
2
|
import { ReadLimits, SheetInfo } from "./read.cjs";
|
|
3
3
|
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.cjs";
|
|
4
4
|
import { D as Sheet, s as CellInput } from "./model-BUNp7B0Z.cjs";
|
|
@@ -560,6 +560,7 @@ var ReadContext = class {
|
|
|
560
560
|
if (where?.ref !== void 0) w.ref = where.ref;
|
|
561
561
|
if (where?.partKind !== void 0) w.partKind = where.partKind;
|
|
562
562
|
if (where?.parts !== void 0) w.parts = where.parts;
|
|
563
|
+
if (where?.relationshipTypes !== void 0) w.relationshipTypes = where.relationshipTypes;
|
|
563
564
|
this.tap?.(w);
|
|
564
565
|
if (this.cap.add(w, (dropped) => {
|
|
565
566
|
const t = {
|
|
@@ -698,6 +699,39 @@ function stripBom(b) {
|
|
|
698
699
|
if (b[0] === 255 && b[1] === 254 || b[0] === 254 && b[1] === 255) return b.subarray(2);
|
|
699
700
|
return b;
|
|
700
701
|
}
|
|
702
|
+
// src/internal/read/opc.ts
|
|
703
|
+
/**
|
|
704
|
+
* Open Packaging Conventions for the reader: part lookup by part-name
|
|
705
|
+
* equivalence (percent-decoded once, case-insensitive, as OPC requires),
|
|
706
|
+
* [Content_Types].xml and relationship parts. Internal.
|
|
707
|
+
*/
|
|
708
|
+
/** A URI scheme (RFC 3986) at the start, after spaces; a network-path reference (`//`); or a backslash anywhere. */
|
|
709
|
+
function pointsOutside(target) {
|
|
710
|
+
if (target.includes("\\")) return true;
|
|
711
|
+
const t = target.trimStart();
|
|
712
|
+
return t.startsWith("//") || /^[A-Za-z][A-Za-z0-9+.-]*:/.test(t);
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* Whether the attributes of a `<Relationship>` read as internal may name a
|
|
716
|
+
* target outside the package (Relationship.outside). One pass over the
|
|
717
|
+
* attributes as written (duplicates included), linear in the tag.
|
|
718
|
+
*/
|
|
719
|
+
function outsideByAttributes(a) {
|
|
720
|
+
let modes = 0;
|
|
721
|
+
for (const [q, v] of a.entries()) {
|
|
722
|
+
const colon = q.indexOf(":");
|
|
723
|
+
if (q === "xmlns" || colon > 0 && q.slice(0, colon) === "xmlns") continue;
|
|
724
|
+
const len = q.length - colon - 1;
|
|
725
|
+
if (len !== 10 && len !== 6) continue;
|
|
726
|
+
const local = (colon === -1 ? q : q.slice(colon + 1)).toLowerCase();
|
|
727
|
+
if (local === "targetmode") {
|
|
728
|
+
if (q !== "TargetMode" || ++modes > 1) return true;
|
|
729
|
+
const mode = v.toLowerCase();
|
|
730
|
+
if (mode !== "internal" && mode !== "external") return true;
|
|
731
|
+
} else if (local === "target" && pointsOutside(v)) return true;
|
|
732
|
+
}
|
|
733
|
+
return false;
|
|
734
|
+
}
|
|
701
735
|
var Package = class {
|
|
702
736
|
ctx;
|
|
703
737
|
/** partKey(name) -> entry. */
|
|
@@ -866,6 +900,7 @@ var Package = class {
|
|
|
866
900
|
target: "",
|
|
867
901
|
external
|
|
868
902
|
};
|
|
903
|
+
if (!external && outsideByAttributes(a)) rel.outside = true;
|
|
869
904
|
if (target === void 0) {
|
|
870
905
|
malformed.push(rel);
|
|
871
906
|
return;
|
|
@@ -3940,6 +3975,14 @@ const REPORTED_ANYWHERE = /* @__PURE__ */ new Set([
|
|
|
3940
3975
|
"webExtension"
|
|
3941
3976
|
]);
|
|
3942
3977
|
/**
|
|
3978
|
+
* Hyperlink relationship types (lower case), transitional and strict: their
|
|
3979
|
+
* external targets open only when a user follows the link, so they are not
|
|
3980
|
+
* reported as `externalTarget` (JSE-85). Compared as whole URIs, not by last
|
|
3981
|
+
* segment, so a made-up type ending in `/hyperlink` is reported.
|
|
3982
|
+
*/
|
|
3983
|
+
const HYPERLINK_TYPES = /* @__PURE__ */ new Set(["http://schemas.openxmlformats.org/officedocument/2006/relationships/hyperlink", "http://purl.oclc.org/ooxml/officedocument/relationships/hyperlink"]);
|
|
3984
|
+
const HYPERLINK_TYPE_LENGTH = Math.max(...[...HYPERLINK_TYPES].map((t) => t.length));
|
|
3985
|
+
/**
|
|
3943
3986
|
* The kind a relationship names, by its type alone: the last segment of the
|
|
3944
3987
|
* type URI, compared without regard to case, or an alias (RELATIONSHIP_ALIASES).
|
|
3945
3988
|
* customUI is matched on the whole type (`.../ui/extensibility`).
|
|
@@ -3990,6 +4033,12 @@ async function scanPackageParts(pkg) {
|
|
|
3990
4033
|
source: "",
|
|
3991
4034
|
counts: true
|
|
3992
4035
|
}];
|
|
4036
|
+
const external = {
|
|
4037
|
+
count: 0,
|
|
4038
|
+
parts: [],
|
|
4039
|
+
types: []
|
|
4040
|
+
};
|
|
4041
|
+
const externalTypes = /* @__PURE__ */ new Set();
|
|
3993
4042
|
const visit = (target, counts) => {
|
|
3994
4043
|
const entry = pkg.part(target);
|
|
3995
4044
|
if (!entry) return;
|
|
@@ -4040,11 +4089,26 @@ async function scanPackageParts(pkg) {
|
|
|
4040
4089
|
const malformed = pkg.malformedRels.get(relsEntry.name) ?? [];
|
|
4041
4090
|
if (malformed.length) forbidden.add(relsEntry.name);
|
|
4042
4091
|
const all = malformed.length ? [...rels, ...malformed] : rels;
|
|
4092
|
+
let externalHere = false;
|
|
4043
4093
|
for (let i = 0; i < all.length; i++) {
|
|
4044
4094
|
if ((i & 4095) === 4095) ctx.checkAbort();
|
|
4045
4095
|
const rel = all[i];
|
|
4046
4096
|
if (rel.forbidden) forbidden.add(relsEntry.name);
|
|
4047
4097
|
classify(rel, source, relsEntry.name);
|
|
4098
|
+
if ((rel.external || rel.outside) && !isHyperlink(rel)) {
|
|
4099
|
+
external.count++;
|
|
4100
|
+
if (!externalHere) {
|
|
4101
|
+
externalHere = true;
|
|
4102
|
+
external.parts.push(relsEntry.name);
|
|
4103
|
+
}
|
|
4104
|
+
if (external.types.length < 16) {
|
|
4105
|
+
const t = rel.type.toLowerCase();
|
|
4106
|
+
if (!externalTypes.has(t)) {
|
|
4107
|
+
externalTypes.add(t);
|
|
4108
|
+
external.types.push(excerpt(rel.type));
|
|
4109
|
+
}
|
|
4110
|
+
}
|
|
4111
|
+
}
|
|
4048
4112
|
if (rel.external || rel.tooLong) continue;
|
|
4049
4113
|
visit(rel.target, counts);
|
|
4050
4114
|
if (rel.altTarget !== void 0) visit(rel.altTarget, counts);
|
|
@@ -4076,9 +4140,14 @@ async function scanPackageParts(pkg) {
|
|
|
4076
4140
|
return {
|
|
4077
4141
|
found,
|
|
4078
4142
|
unreferenced,
|
|
4079
|
-
forbidden: [...forbidden]
|
|
4143
|
+
forbidden: [...forbidden],
|
|
4144
|
+
external
|
|
4080
4145
|
};
|
|
4081
4146
|
}
|
|
4147
|
+
/** A hyperlink relationship (HYPERLINK_TYPES): never reported as `externalTarget`. */
|
|
4148
|
+
function isHyperlink(rel) {
|
|
4149
|
+
return rel.type.length <= HYPERLINK_TYPE_LENGTH && HYPERLINK_TYPES.has(rel.type.toLowerCase());
|
|
4150
|
+
}
|
|
4082
4151
|
// src/internal/read/formats.ts
|
|
4083
4152
|
/** Container signatures, checked in order. */
|
|
4084
4153
|
const CONTAINERS = [
|
|
@@ -4585,7 +4654,9 @@ function warnUnsupportedParts(ctx, rels, part, seen) {
|
|
|
4585
4654
|
/**
|
|
4586
4655
|
* After the sheets (JSE-72): the kinds in REPORTED_ANYWHERE that the
|
|
4587
4656
|
* workbook's and the read sheets' relationships did not already report,
|
|
4588
|
-
* wherever the package scan found them, then one `
|
|
4657
|
+
* wherever the package scan found them, then one `externalTarget` warning
|
|
4658
|
+
* for all non-hyperlink relationships that point, or may point, outside the
|
|
4659
|
+
* package, whatever their kind (JSE-85), one `invalidPartName` warning
|
|
4589
4660
|
* for all names OPC forbids and one `unreferencedPart` warning for all parts
|
|
4590
4661
|
* no relationship reaches, each listing every name in `parts`.
|
|
4591
4662
|
*/
|
|
@@ -4601,6 +4672,17 @@ async function warnScannedParts(pkg, seen) {
|
|
|
4601
4672
|
partKind: f.kind
|
|
4602
4673
|
});
|
|
4603
4674
|
}
|
|
4675
|
+
const ext = scan.external;
|
|
4676
|
+
if (ext.count > 0) {
|
|
4677
|
+
const first = ext.parts[0];
|
|
4678
|
+
const message = ext.count === 1 ? `The package has 1 relationship to a target outside the file (in "${excerpt(first)}"); it is not read or fetched, but Excel may fetch it when the file is opened.` : `The package has ${ext.count} relationships to targets outside the file (in ${ext.parts.length} relationships part${ext.parts.length === 1 ? "" : "s"}; first in "${excerpt(first)}"); they are not read or fetched, but Excel may fetch them when the file is opened.`;
|
|
4679
|
+
ctx.warn("UNSUPPORTED_PART", message, {
|
|
4680
|
+
part: first,
|
|
4681
|
+
partKind: "externalTarget",
|
|
4682
|
+
parts: ext.parts,
|
|
4683
|
+
relationshipTypes: ext.types
|
|
4684
|
+
});
|
|
4685
|
+
}
|
|
4604
4686
|
const bad = scan.forbidden;
|
|
4605
4687
|
if (bad.length > 0) {
|
|
4606
4688
|
const first = bad[0];
|
|
@@ -560,6 +560,7 @@ var ReadContext = class {
|
|
|
560
560
|
if (where?.ref !== void 0) w.ref = where.ref;
|
|
561
561
|
if (where?.partKind !== void 0) w.partKind = where.partKind;
|
|
562
562
|
if (where?.parts !== void 0) w.parts = where.parts;
|
|
563
|
+
if (where?.relationshipTypes !== void 0) w.relationshipTypes = where.relationshipTypes;
|
|
563
564
|
this.tap?.(w);
|
|
564
565
|
if (this.cap.add(w, (dropped) => {
|
|
565
566
|
const t = {
|
|
@@ -698,6 +699,39 @@ function stripBom(b) {
|
|
|
698
699
|
if (b[0] === 255 && b[1] === 254 || b[0] === 254 && b[1] === 255) return b.subarray(2);
|
|
699
700
|
return b;
|
|
700
701
|
}
|
|
702
|
+
// src/internal/read/opc.ts
|
|
703
|
+
/**
|
|
704
|
+
* Open Packaging Conventions for the reader: part lookup by part-name
|
|
705
|
+
* equivalence (percent-decoded once, case-insensitive, as OPC requires),
|
|
706
|
+
* [Content_Types].xml and relationship parts. Internal.
|
|
707
|
+
*/
|
|
708
|
+
/** A URI scheme (RFC 3986) at the start, after spaces; a network-path reference (`//`); or a backslash anywhere. */
|
|
709
|
+
function pointsOutside(target) {
|
|
710
|
+
if (target.includes("\\")) return true;
|
|
711
|
+
const t = target.trimStart();
|
|
712
|
+
return t.startsWith("//") || /^[A-Za-z][A-Za-z0-9+.-]*:/.test(t);
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* Whether the attributes of a `<Relationship>` read as internal may name a
|
|
716
|
+
* target outside the package (Relationship.outside). One pass over the
|
|
717
|
+
* attributes as written (duplicates included), linear in the tag.
|
|
718
|
+
*/
|
|
719
|
+
function outsideByAttributes(a) {
|
|
720
|
+
let modes = 0;
|
|
721
|
+
for (const [q, v] of a.entries()) {
|
|
722
|
+
const colon = q.indexOf(":");
|
|
723
|
+
if (q === "xmlns" || colon > 0 && q.slice(0, colon) === "xmlns") continue;
|
|
724
|
+
const len = q.length - colon - 1;
|
|
725
|
+
if (len !== 10 && len !== 6) continue;
|
|
726
|
+
const local = (colon === -1 ? q : q.slice(colon + 1)).toLowerCase();
|
|
727
|
+
if (local === "targetmode") {
|
|
728
|
+
if (q !== "TargetMode" || ++modes > 1) return true;
|
|
729
|
+
const mode = v.toLowerCase();
|
|
730
|
+
if (mode !== "internal" && mode !== "external") return true;
|
|
731
|
+
} else if (local === "target" && pointsOutside(v)) return true;
|
|
732
|
+
}
|
|
733
|
+
return false;
|
|
734
|
+
}
|
|
701
735
|
var Package = class {
|
|
702
736
|
ctx;
|
|
703
737
|
/** partKey(name) -> entry. */
|
|
@@ -866,6 +900,7 @@ var Package = class {
|
|
|
866
900
|
target: "",
|
|
867
901
|
external
|
|
868
902
|
};
|
|
903
|
+
if (!external && outsideByAttributes(a)) rel.outside = true;
|
|
869
904
|
if (target === void 0) {
|
|
870
905
|
malformed.push(rel);
|
|
871
906
|
return;
|
|
@@ -3940,6 +3975,14 @@ const REPORTED_ANYWHERE = /* @__PURE__ */ new Set([
|
|
|
3940
3975
|
"webExtension"
|
|
3941
3976
|
]);
|
|
3942
3977
|
/**
|
|
3978
|
+
* Hyperlink relationship types (lower case), transitional and strict: their
|
|
3979
|
+
* external targets open only when a user follows the link, so they are not
|
|
3980
|
+
* reported as `externalTarget` (JSE-85). Compared as whole URIs, not by last
|
|
3981
|
+
* segment, so a made-up type ending in `/hyperlink` is reported.
|
|
3982
|
+
*/
|
|
3983
|
+
const HYPERLINK_TYPES = /* @__PURE__ */ new Set(["http://schemas.openxmlformats.org/officedocument/2006/relationships/hyperlink", "http://purl.oclc.org/ooxml/officedocument/relationships/hyperlink"]);
|
|
3984
|
+
const HYPERLINK_TYPE_LENGTH = Math.max(...[...HYPERLINK_TYPES].map((t) => t.length));
|
|
3985
|
+
/**
|
|
3943
3986
|
* The kind a relationship names, by its type alone: the last segment of the
|
|
3944
3987
|
* type URI, compared without regard to case, or an alias (RELATIONSHIP_ALIASES).
|
|
3945
3988
|
* customUI is matched on the whole type (`.../ui/extensibility`).
|
|
@@ -3990,6 +4033,12 @@ async function scanPackageParts(pkg) {
|
|
|
3990
4033
|
source: "",
|
|
3991
4034
|
counts: true
|
|
3992
4035
|
}];
|
|
4036
|
+
const external = {
|
|
4037
|
+
count: 0,
|
|
4038
|
+
parts: [],
|
|
4039
|
+
types: []
|
|
4040
|
+
};
|
|
4041
|
+
const externalTypes = /* @__PURE__ */ new Set();
|
|
3993
4042
|
const visit = (target, counts) => {
|
|
3994
4043
|
const entry = pkg.part(target);
|
|
3995
4044
|
if (!entry) return;
|
|
@@ -4040,11 +4089,26 @@ async function scanPackageParts(pkg) {
|
|
|
4040
4089
|
const malformed = pkg.malformedRels.get(relsEntry.name) ?? [];
|
|
4041
4090
|
if (malformed.length) forbidden.add(relsEntry.name);
|
|
4042
4091
|
const all = malformed.length ? [...rels, ...malformed] : rels;
|
|
4092
|
+
let externalHere = false;
|
|
4043
4093
|
for (let i = 0; i < all.length; i++) {
|
|
4044
4094
|
if ((i & 4095) === 4095) ctx.checkAbort();
|
|
4045
4095
|
const rel = all[i];
|
|
4046
4096
|
if (rel.forbidden) forbidden.add(relsEntry.name);
|
|
4047
4097
|
classify(rel, source, relsEntry.name);
|
|
4098
|
+
if ((rel.external || rel.outside) && !isHyperlink(rel)) {
|
|
4099
|
+
external.count++;
|
|
4100
|
+
if (!externalHere) {
|
|
4101
|
+
externalHere = true;
|
|
4102
|
+
external.parts.push(relsEntry.name);
|
|
4103
|
+
}
|
|
4104
|
+
if (external.types.length < 16) {
|
|
4105
|
+
const t = rel.type.toLowerCase();
|
|
4106
|
+
if (!externalTypes.has(t)) {
|
|
4107
|
+
externalTypes.add(t);
|
|
4108
|
+
external.types.push(excerpt(rel.type));
|
|
4109
|
+
}
|
|
4110
|
+
}
|
|
4111
|
+
}
|
|
4048
4112
|
if (rel.external || rel.tooLong) continue;
|
|
4049
4113
|
visit(rel.target, counts);
|
|
4050
4114
|
if (rel.altTarget !== void 0) visit(rel.altTarget, counts);
|
|
@@ -4076,9 +4140,14 @@ async function scanPackageParts(pkg) {
|
|
|
4076
4140
|
return {
|
|
4077
4141
|
found,
|
|
4078
4142
|
unreferenced,
|
|
4079
|
-
forbidden: [...forbidden]
|
|
4143
|
+
forbidden: [...forbidden],
|
|
4144
|
+
external
|
|
4080
4145
|
};
|
|
4081
4146
|
}
|
|
4147
|
+
/** A hyperlink relationship (HYPERLINK_TYPES): never reported as `externalTarget`. */
|
|
4148
|
+
function isHyperlink(rel) {
|
|
4149
|
+
return rel.type.length <= HYPERLINK_TYPE_LENGTH && HYPERLINK_TYPES.has(rel.type.toLowerCase());
|
|
4150
|
+
}
|
|
4082
4151
|
// src/internal/read/formats.ts
|
|
4083
4152
|
/** Container signatures, checked in order. */
|
|
4084
4153
|
const CONTAINERS = [
|
|
@@ -4585,7 +4654,9 @@ function warnUnsupportedParts(ctx, rels, part, seen) {
|
|
|
4585
4654
|
/**
|
|
4586
4655
|
* After the sheets (JSE-72): the kinds in REPORTED_ANYWHERE that the
|
|
4587
4656
|
* workbook's and the read sheets' relationships did not already report,
|
|
4588
|
-
* wherever the package scan found them, then one `
|
|
4657
|
+
* wherever the package scan found them, then one `externalTarget` warning
|
|
4658
|
+
* for all non-hyperlink relationships that point, or may point, outside the
|
|
4659
|
+
* package, whatever their kind (JSE-85), one `invalidPartName` warning
|
|
4589
4660
|
* for all names OPC forbids and one `unreferencedPart` warning for all parts
|
|
4590
4661
|
* no relationship reaches, each listing every name in `parts`.
|
|
4591
4662
|
*/
|
|
@@ -4601,6 +4672,17 @@ async function warnScannedParts(pkg, seen) {
|
|
|
4601
4672
|
partKind: f.kind
|
|
4602
4673
|
});
|
|
4603
4674
|
}
|
|
4675
|
+
const ext = scan.external;
|
|
4676
|
+
if (ext.count > 0) {
|
|
4677
|
+
const first = ext.parts[0];
|
|
4678
|
+
const message = ext.count === 1 ? `The package has 1 relationship to a target outside the file (in "${excerpt(first)}"); it is not read or fetched, but Excel may fetch it when the file is opened.` : `The package has ${ext.count} relationships to targets outside the file (in ${ext.parts.length} relationships part${ext.parts.length === 1 ? "" : "s"}; first in "${excerpt(first)}"); they are not read or fetched, but Excel may fetch them when the file is opened.`;
|
|
4679
|
+
ctx.warn("UNSUPPORTED_PART", message, {
|
|
4680
|
+
part: first,
|
|
4681
|
+
partKind: "externalTarget",
|
|
4682
|
+
parts: ext.parts,
|
|
4683
|
+
relationshipTypes: ext.types
|
|
4684
|
+
});
|
|
4685
|
+
}
|
|
4604
4686
|
const bad = scan.forbidden;
|
|
4605
4687
|
if (bad.length > 0) {
|
|
4606
4688
|
const first = bad[0];
|
package/dist/read.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_warnings = require("./warnings-CJPiDqei.cjs");
|
|
3
|
-
const require_read = require("./read-
|
|
3
|
+
const require_read = require("./read-X1KxggZ7.cjs");
|
|
4
4
|
exports.DEFAULT_READ_LIMITS = require_read.DEFAULT_READ_LIMITS;
|
|
5
5
|
exports.detectFormat = require_read.detectFormat;
|
|
6
6
|
exports.inspect = require_read.inspect;
|
package/dist/read.d.cts
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @module javascript-excel/read
|
|
12
12
|
*/
|
|
13
|
-
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-
|
|
13
|
+
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-Bphby2c7.cjs";
|
|
14
14
|
import { A as Theme, C as PrintSetup, D as Sheet, E as RowProps, O as SheetView, S as PatternType, T as RichTextRun, _ as Font, a as Cell, b as NumFmt, c as CellType, d as ColumnProps, f as ColumnWidth, g as Fill, h as ErrorCode, i as BorderStyle, j as Workbook, k as Style, l as CellValue, m as DocProperties, n as Border, o as CellErrorValue, p as DefinedName, r as BorderSide, s as CellInput, t as Alignment, u as Color, v as GradientFill, w as RichText, x as PatternFill, y as Hyperlink } from "./model-BUNp7B0Z.cjs";
|
|
15
15
|
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.cjs";
|
|
16
|
-
import { t as Progress } from "./write-
|
|
16
|
+
import { t as Progress } from "./write-BbV7BlbS.cjs";
|
|
17
17
|
/** Result of `read`. */
|
|
18
18
|
export interface ReadResult {
|
|
19
19
|
workbook: Workbook<Cell>;
|
package/dist/read.d.ts
CHANGED
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @module javascript-excel/read
|
|
12
12
|
*/
|
|
13
|
-
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-
|
|
13
|
+
import { a as isDataLossWarning, c as BlobType, i as ExcelWarningCode, n as ExcelPartKind, o as BinaryInput, r as ExcelWarning, s as BlobLike, t as DroppedWarnings } from "./warnings-Bphby2c7.js";
|
|
14
14
|
import { A as Theme, C as PrintSetup, D as Sheet, E as RowProps, O as SheetView, S as PatternType, T as RichTextRun, _ as Font, a as Cell, b as NumFmt, c as CellType, d as ColumnProps, f as ColumnWidth, g as Fill, h as ErrorCode, i as BorderStyle, j as Workbook, k as Style, l as CellValue, m as DocProperties, n as Border, o as CellErrorValue, p as DefinedName, r as BorderSide, s as CellInput, t as Alignment, u as Color, v as GradientFill, w as RichText, x as PatternFill, y as Hyperlink } from "./model-BUNp7B0Z.js";
|
|
15
15
|
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.js";
|
|
16
|
-
import { t as Progress } from "./write-
|
|
16
|
+
import { t as Progress } from "./write-DryxCc2Q.js";
|
|
17
17
|
/** Result of `read`. */
|
|
18
18
|
export interface ReadResult {
|
|
19
19
|
workbook: Workbook<Cell>;
|
package/dist/read.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { t as isDataLossWarning } from "./warnings-BPz1Ia3s.js";
|
|
2
|
-
import { a as readSheetNames, i as read, n as detectFormat, r as inspect, t as DEFAULT_READ_LIMITS } from "./read-
|
|
2
|
+
import { a as readSheetNames, i as read, n as detectFormat, r as inspect, t as DEFAULT_READ_LIMITS } from "./read-CrI550TK.js";
|
|
3
3
|
export { DEFAULT_READ_LIMITS, detectFormat, inspect, isDataLossWarning, read, readSheetNames };
|
|
@@ -36,10 +36,15 @@ type ExcelWarningCode = "UNSUPPORTED_PART" | "INVALID_STYLE_INDEX" | "INVALID_SH
|
|
|
36
36
|
* adds are named for what they are: `'activeX'` (ActiveX controls),
|
|
37
37
|
* `'embeddedPackage'` (embedded files), `'customUI'` (ribbon customisation),
|
|
38
38
|
* `'webExtension'` (Office web add-ins), `'invalidPartName'` (a part name,
|
|
39
|
-
* relationship target, Override PartName or relationship OPC forbids) and `'unreferencedPart'` (a part no relationship reaches).
|
|
39
|
+
* relationship target, Override PartName or relationship OPC forbids) and `'unreferencedPart'` (a part no relationship reaches).
|
|
40
|
+
* `'externalTarget'` (since 2.6) is any relationship that is not a hyperlink
|
|
41
|
+
* and is external, or may be read as external (an odd or duplicate
|
|
42
|
+
* TargetMode, an internal target with a URI scheme, `//` or a backslash),
|
|
43
|
+
* whatever its kind, such as a linked picture Excel fetches when the file
|
|
44
|
+
* is opened. Kinds may be added in a minor
|
|
40
45
|
* release, so a `switch` over it needs a `default` branch.
|
|
41
46
|
*/
|
|
42
|
-
type ExcelPartKind = "worksheet" | "sharedStrings" | "styles" | "theme" | "coreProperties" | "extendedProperties" | "customProperties" | "drawing" | "vmlDrawing" | "comments" | "threadedComment" | "pivotTable" | "pivotCacheDefinition" | "table" | "oleObject" | "ctrlProp" | "image" | "vbaProject" | "externalLink" | "connections" | "queryTable" | "slicer" | "slicerCache" | "timeline" | "chartsheet" | "dialogsheet" | "macrosheet" | "activeX" | "embeddedPackage" | "customUI" | "webExtension" | "invalidPartName" | "unreferencedPart";
|
|
47
|
+
type ExcelPartKind = "worksheet" | "sharedStrings" | "styles" | "theme" | "coreProperties" | "extendedProperties" | "customProperties" | "drawing" | "vmlDrawing" | "comments" | "threadedComment" | "pivotTable" | "pivotCacheDefinition" | "table" | "oleObject" | "ctrlProp" | "image" | "vbaProject" | "externalLink" | "connections" | "queryTable" | "slicer" | "slicerCache" | "timeline" | "chartsheet" | "dialogsheet" | "macrosheet" | "activeX" | "embeddedPackage" | "customUI" | "webExtension" | "invalidPartName" | "unreferencedPart" | "externalTarget";
|
|
43
48
|
/** What the warning cap left out; on `WARNINGS_TRUNCATED` only. */
|
|
44
49
|
interface DroppedWarnings {
|
|
45
50
|
/** Warnings not recorded, in total. */
|
|
@@ -67,10 +72,20 @@ interface ExcelWarning {
|
|
|
67
72
|
/**
|
|
68
73
|
* On `UNSUPPORTED_PART` with `partKind` `'unreferencedPart'` or
|
|
69
74
|
* `'invalidPartName'` (since 2.5): every such name, in the order found
|
|
70
|
-
* (`part` is the first).
|
|
75
|
+
* (`part` is the first). With `'externalTarget'` (since 2.6): every
|
|
76
|
+
* relationships part that holds such a relationship, in the order the
|
|
77
|
+
* package scan reads them. Each is a zip entry name, at most once, so the
|
|
71
78
|
* list is bounded by `maxEntries`.
|
|
72
79
|
*/
|
|
73
80
|
parts?: string[] | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* On `UNSUPPORTED_PART` with `partKind` `'externalTarget'` (since 2.6): the
|
|
83
|
+
* relationship types of those relationships, the first 16 distinct ones
|
|
84
|
+
* (compared without regard to case), each as written when it is at most
|
|
85
|
+
* 128 characters, else its first 64, `…` and its length. Targets are never
|
|
86
|
+
* included.
|
|
87
|
+
*/
|
|
88
|
+
relationshipTypes?: string[] | undefined;
|
|
74
89
|
/**
|
|
75
90
|
* On `WARNINGS_TRUNCATED`: counts of the warnings that were not recorded. The
|
|
76
91
|
* counts are final in the returned `warnings` only. `read` calls `onWarning`
|
|
@@ -36,10 +36,15 @@ type ExcelWarningCode = "UNSUPPORTED_PART" | "INVALID_STYLE_INDEX" | "INVALID_SH
|
|
|
36
36
|
* adds are named for what they are: `'activeX'` (ActiveX controls),
|
|
37
37
|
* `'embeddedPackage'` (embedded files), `'customUI'` (ribbon customisation),
|
|
38
38
|
* `'webExtension'` (Office web add-ins), `'invalidPartName'` (a part name,
|
|
39
|
-
* relationship target, Override PartName or relationship OPC forbids) and `'unreferencedPart'` (a part no relationship reaches).
|
|
39
|
+
* relationship target, Override PartName or relationship OPC forbids) and `'unreferencedPart'` (a part no relationship reaches).
|
|
40
|
+
* `'externalTarget'` (since 2.6) is any relationship that is not a hyperlink
|
|
41
|
+
* and is external, or may be read as external (an odd or duplicate
|
|
42
|
+
* TargetMode, an internal target with a URI scheme, `//` or a backslash),
|
|
43
|
+
* whatever its kind, such as a linked picture Excel fetches when the file
|
|
44
|
+
* is opened. Kinds may be added in a minor
|
|
40
45
|
* release, so a `switch` over it needs a `default` branch.
|
|
41
46
|
*/
|
|
42
|
-
type ExcelPartKind = "worksheet" | "sharedStrings" | "styles" | "theme" | "coreProperties" | "extendedProperties" | "customProperties" | "drawing" | "vmlDrawing" | "comments" | "threadedComment" | "pivotTable" | "pivotCacheDefinition" | "table" | "oleObject" | "ctrlProp" | "image" | "vbaProject" | "externalLink" | "connections" | "queryTable" | "slicer" | "slicerCache" | "timeline" | "chartsheet" | "dialogsheet" | "macrosheet" | "activeX" | "embeddedPackage" | "customUI" | "webExtension" | "invalidPartName" | "unreferencedPart";
|
|
47
|
+
type ExcelPartKind = "worksheet" | "sharedStrings" | "styles" | "theme" | "coreProperties" | "extendedProperties" | "customProperties" | "drawing" | "vmlDrawing" | "comments" | "threadedComment" | "pivotTable" | "pivotCacheDefinition" | "table" | "oleObject" | "ctrlProp" | "image" | "vbaProject" | "externalLink" | "connections" | "queryTable" | "slicer" | "slicerCache" | "timeline" | "chartsheet" | "dialogsheet" | "macrosheet" | "activeX" | "embeddedPackage" | "customUI" | "webExtension" | "invalidPartName" | "unreferencedPart" | "externalTarget";
|
|
43
48
|
/** What the warning cap left out; on `WARNINGS_TRUNCATED` only. */
|
|
44
49
|
interface DroppedWarnings {
|
|
45
50
|
/** Warnings not recorded, in total. */
|
|
@@ -67,10 +72,20 @@ interface ExcelWarning {
|
|
|
67
72
|
/**
|
|
68
73
|
* On `UNSUPPORTED_PART` with `partKind` `'unreferencedPart'` or
|
|
69
74
|
* `'invalidPartName'` (since 2.5): every such name, in the order found
|
|
70
|
-
* (`part` is the first).
|
|
75
|
+
* (`part` is the first). With `'externalTarget'` (since 2.6): every
|
|
76
|
+
* relationships part that holds such a relationship, in the order the
|
|
77
|
+
* package scan reads them. Each is a zip entry name, at most once, so the
|
|
71
78
|
* list is bounded by `maxEntries`.
|
|
72
79
|
*/
|
|
73
80
|
parts?: string[] | undefined;
|
|
81
|
+
/**
|
|
82
|
+
* On `UNSUPPORTED_PART` with `partKind` `'externalTarget'` (since 2.6): the
|
|
83
|
+
* relationship types of those relationships, the first 16 distinct ones
|
|
84
|
+
* (compared without regard to case), each as written when it is at most
|
|
85
|
+
* 128 characters, else its first 64, `…` and its length. Targets are never
|
|
86
|
+
* included.
|
|
87
|
+
*/
|
|
88
|
+
relationshipTypes?: string[] | undefined;
|
|
74
89
|
/**
|
|
75
90
|
* On `WARNINGS_TRUNCATED`: counts of the warnings that were not recorded. The
|
|
76
91
|
* counts are final in the returned `warnings` only. `read` calls `onWarning`
|
package/dist/worker.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_csv = require("./csv-BkVmMYQq.cjs");
|
|
3
3
|
const require_errors = require("./errors-CKYdpCoB.cjs");
|
|
4
|
-
const require_read = require("./read-
|
|
5
|
-
const require_pipeline = require("./pipeline-
|
|
4
|
+
const require_read = require("./read-X1KxggZ7.cjs");
|
|
5
|
+
const require_pipeline = require("./pipeline-C13EIWHJ.cjs");
|
|
6
6
|
const require_write = require("./write-Bgl_QfA8.cjs");
|
|
7
7
|
// src/worker.ts
|
|
8
8
|
/** Marks the library's messages, so an app can use the same worker for its own messages too. */
|
package/dist/worker.d.cts
CHANGED
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
*
|
|
22
22
|
* @module javascript-excel/worker
|
|
23
23
|
*/
|
|
24
|
-
import { o as BinaryInput } from "./warnings-
|
|
24
|
+
import { o as BinaryInput } from "./warnings-Bphby2c7.cjs";
|
|
25
25
|
import { CsvParseOptions, CsvParseResult, CsvReadOptions, CsvWriteOptions } from "./csv.cjs";
|
|
26
26
|
import { D as Sheet, j as Workbook, s as CellInput } from "./model-BUNp7B0Z.cjs";
|
|
27
27
|
import { ReadOptions, ReadResult } from "./read.cjs";
|
|
28
|
-
import { n as ImportDatasetOptions, r as ImportDatasetResult } from "./pipeline-
|
|
29
|
-
import { n as WriteOptions, t as Progress } from "./write-
|
|
28
|
+
import { n as ImportDatasetOptions, r as ImportDatasetResult } from "./pipeline-C7R86kQg.cjs";
|
|
29
|
+
import { n as WriteOptions, t as Progress } from "./write-BbV7BlbS.cjs";
|
|
30
30
|
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.cjs";
|
|
31
31
|
/** The side of a message channel the library uses: a `Worker`, the worker's `self`, or a `MessagePort`. */
|
|
32
32
|
export interface MessageEndpoint {
|
package/dist/worker.d.ts
CHANGED
|
@@ -21,12 +21,12 @@
|
|
|
21
21
|
*
|
|
22
22
|
* @module javascript-excel/worker
|
|
23
23
|
*/
|
|
24
|
-
import { o as BinaryInput } from "./warnings-
|
|
24
|
+
import { o as BinaryInput } from "./warnings-Bphby2c7.js";
|
|
25
25
|
import { CsvParseOptions, CsvParseResult, CsvReadOptions, CsvWriteOptions } from "./csv.js";
|
|
26
26
|
import { D as Sheet, j as Workbook, s as CellInput } from "./model-BUNp7B0Z.js";
|
|
27
27
|
import { ReadOptions, ReadResult } from "./read.js";
|
|
28
|
-
import { n as ImportDatasetOptions, r as ImportDatasetResult } from "./pipeline-
|
|
29
|
-
import { n as WriteOptions, t as Progress } from "./write-
|
|
28
|
+
import { n as ImportDatasetOptions, r as ImportDatasetResult } from "./pipeline-BY-SiQWW.js";
|
|
29
|
+
import { n as WriteOptions, t as Progress } from "./write-DryxCc2Q.js";
|
|
30
30
|
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.js";
|
|
31
31
|
/** The side of a message channel the library uses: a `Worker`, the worker's `self`, or a `MessagePort`. */
|
|
32
32
|
export interface MessageEndpoint {
|
package/dist/worker.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { i as toCsv, r as readCsv } from "./csv-5jVhfM5l.js";
|
|
2
2
|
import { a as LimitError, i as FormatError, n as EnvironmentError, o as ValidationError, r as ExcelError, s as isExcelError, t as CsvError } from "./errors-BQE62PFo.js";
|
|
3
|
-
import { i as read } from "./read-
|
|
4
|
-
import { t as importDataset } from "./pipeline-
|
|
3
|
+
import { i as read } from "./read-CrI550TK.js";
|
|
4
|
+
import { t as importDataset } from "./pipeline-BRzRd5v3.js";
|
|
5
5
|
import { r as toUint8Array } from "./write-DFz-h8gz.js";
|
|
6
6
|
// src/worker.ts
|
|
7
7
|
/** Marks the library's messages, so an app can use the same worker for its own messages too. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as BlobType } from "./warnings-
|
|
1
|
+
import { c as BlobType } from "./warnings-Bphby2c7.cjs";
|
|
2
2
|
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.cjs";
|
|
3
3
|
import { j as Workbook } from "./model-BUNp7B0Z.cjs";
|
|
4
4
|
/** MIME type of an .xlsx file. */
|
package/package.json
CHANGED