documents.js 2.3.0 → 2.3.2

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.
@@ -306,14 +306,24 @@ function odbToXlsx(bytes, options) {
306
306
  const tables = require_odb_read.readOdbTables(pkg, { timeZone: options?.timeZone });
307
307
  require_ports_abort.throwIfAborted(options?.signal);
308
308
  const content = require_odb_spreadsheet.odbTablesToSpreadsheetDocument(tables);
309
- return (0, ooxml_js.encodePackage)((0, ooxml_js.buildXlsxPackage)(content));
309
+ const out = (0, ooxml_js.encodePackage)((0, ooxml_js.buildXlsxPackage)(content));
310
+ options?.onDocument?.({
311
+ formatVersion: document_schema_js.DOCUMENT_PACKAGE_FORMAT_VERSION,
312
+ content
313
+ });
314
+ return out;
310
315
  }
311
316
  function odbToCsv(bytes, options) {
312
317
  require_ports_abort.throwIfAborted(options?.signal);
313
318
  const pkg = (0, odf_js.decodePackage)(bytes);
314
319
  const tables = require_odb_read.readOdbTables(pkg, { timeZone: options?.timeZone });
315
320
  require_ports_abort.throwIfAborted(options?.signal);
316
- return require_odb_csv.buildOdbTableCsv(tables, options?.table);
321
+ const csv = require_odb_csv.buildOdbTableCsv(tables, options?.table);
322
+ if (options?.onDocument !== void 0) options.onDocument({
323
+ formatVersion: document_schema_js.DOCUMENT_PACKAGE_FORMAT_VERSION,
324
+ content: require_odb_spreadsheet.odbTablesToSpreadsheetDocument(tables)
325
+ });
326
+ return csv;
317
327
  }
318
328
  function odbReportToDocx(content, options) {
319
329
  require_ports_abort.throwIfAborted(options?.signal);
@@ -305,14 +305,24 @@ function odbToXlsx(bytes, options) {
305
305
  const tables = readOdbTables(pkg, { timeZone: options?.timeZone });
306
306
  throwIfAborted(options?.signal);
307
307
  const content = odbTablesToSpreadsheetDocument(tables);
308
- return encodePackage(buildXlsxPackage(content));
308
+ const out = encodePackage(buildXlsxPackage(content));
309
+ options?.onDocument?.({
310
+ formatVersion: DOCUMENT_PACKAGE_FORMAT_VERSION,
311
+ content
312
+ });
313
+ return out;
309
314
  }
310
315
  function odbToCsv(bytes, options) {
311
316
  throwIfAborted(options?.signal);
312
317
  const pkg = decodePackage$1(bytes);
313
318
  const tables = readOdbTables(pkg, { timeZone: options?.timeZone });
314
319
  throwIfAborted(options?.signal);
315
- return buildOdbTableCsv(tables, options?.table);
320
+ const csv = buildOdbTableCsv(tables, options?.table);
321
+ if (options?.onDocument !== void 0) options.onDocument({
322
+ formatVersion: DOCUMENT_PACKAGE_FORMAT_VERSION,
323
+ content: odbTablesToSpreadsheetDocument(tables)
324
+ });
325
+ return csv;
316
326
  }
317
327
  function odbReportToDocx(content, options) {
318
328
  throwIfAborted(options?.signal);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "documents.js",
3
- "version": "2.3.0",
3
+ "version": "2.3.2",
4
4
  "description": "Bidirectional docx/pptx <-> PDF conversion and a read+write editable OOXML document model, built on ooxml.js and Zod 4 codecs.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -89,7 +89,7 @@
89
89
  "markdown-codec": "^2.0.0",
90
90
  "odf.js": "^3.0.1",
91
91
  "ooxml.js": "^2.16.0",
92
- "pdf-codec": "^2.2.35",
92
+ "pdf-codec": "^2.2.36",
93
93
  "temml": "0.13.4",
94
94
  "zod": "^4.4.3"
95
95
  },