@evotecit/officeimo 0.1.4 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +18 -4
  2. package/bundles/officeimo-canopyx-adapter.js +1444 -0
  3. package/bundles/officeimo-canopyx-adapter.min.js +2 -0
  4. package/bundles/officeimo-canopyx-adapter.min.mjs +2 -0
  5. package/bundles/officeimo-canopyx-adapter.mjs +1426 -0
  6. package/bundles/officeimo-canopyx.js +108 -50
  7. package/bundles/officeimo-canopyx.min.js +2 -0
  8. package/bundles/officeimo-canopyx.min.mjs +2 -0
  9. package/bundles/officeimo-canopyx.mjs +96 -38
  10. package/bundles/officeimo-csv.min.js +2 -0
  11. package/bundles/officeimo-csv.min.mjs +2 -0
  12. package/bundles/officeimo-datatables-adapter.js +626 -0
  13. package/bundles/officeimo-datatables-adapter.min.js +2 -0
  14. package/bundles/officeimo-datatables-adapter.min.mjs +2 -0
  15. package/bundles/officeimo-datatables-adapter.mjs +617 -0
  16. package/bundles/officeimo-datatables.js +55 -10
  17. package/bundles/officeimo-datatables.min.js +2 -0
  18. package/bundles/officeimo-datatables.min.mjs +2 -0
  19. package/bundles/officeimo-datatables.mjs +51 -6
  20. package/bundles/officeimo-execution.min.js +2 -0
  21. package/bundles/officeimo-execution.min.mjs +2 -0
  22. package/bundles/officeimo-pdf.min.js +2 -0
  23. package/bundles/officeimo-pdf.min.mjs +2 -0
  24. package/bundles/officeimo-xlsx.min.js +2 -0
  25. package/bundles/officeimo-xlsx.min.mjs +2 -0
  26. package/bundles/officeimo.min.js +2 -0
  27. package/bundles/officeimo.min.mjs +2 -0
  28. package/bundles/officeimo.mjs +2 -1
  29. package/dist/integrations/canopyx/pdf-number.d.ts +1 -1
  30. package/dist/integrations/canopyx/pdf-number.js +89 -35
  31. package/dist/integrations/canopyx/pivot.d.ts +1 -1
  32. package/dist/integrations/canopyx/pivot.js +4 -0
  33. package/dist/integrations/canopyx/source.js +2 -2
  34. package/dist/integrations/canopyx/types.d.ts +1 -0
  35. package/dist/integrations/datatables/snapshot.js +51 -6
  36. package/package.json +6 -2
package/README.md CHANGED
@@ -20,7 +20,7 @@ npm pack --pack-destination /path/to/local-packages
20
20
 
21
21
  Install that archive in an isolated consumer with `npm install /path/to/local-packages/evotecit-officeimo-0.1.0.tgz`.
22
22
 
23
- `tsc` produces ES modules and declarations in `dist/`. The archive contains those files, portable bundles, this README and the MIT license. TypeScript is a development dependency; installing the archive as an application dependency installs no compiler or runtime packages.
23
+ `tsc` produces ES modules and declarations in `dist/`. The archive contains those files, portable bundles, this README and the MIT license. TypeScript and esbuild (which minifies the `.min` bundles) are development dependencies; installing the archive as an application dependency installs no compiler or runtime packages.
24
24
 
25
25
  ## Export a table
26
26
 
@@ -207,7 +207,7 @@ const blob = await exportCanopy(capture, "xlsx", {
207
207
 
208
208
  The width profile provides reproducible conversion; it does not promise pixel-identical rendering in native Excel. `columnOptions[id].width` overrides the XLSX character width, and `pdf.columnWidths` overrides PDF point widths. Right and nonleading pins retain their column order and require an explicit text fallback diagnostic. `columnOptions` applies only to selected IDs; native `columnOptions[id].format` remains the explicit Excel-format override.
209
209
 
210
- For a pivot table, pass the frozen `prepareExport({ pivot: true, scope: "filtered", values: "raw" })` capture through the same entry point. Numeric cells retain their already-computed `mode` and native `numberFormat`: a fractional share stays numeric and receives a percent format without multiplying or parsing its text. Empty intersections need neither field; an explicit empty column format selects `General`. Row and column identities are opaque. `recordCount` counts physical projected rows, including summaries; `matched` still describes the underlying accepted records.
210
+ For a pivot table, pass the frozen `prepareExport({ pivot: true, scope: "filtered", values: "raw" })` capture through the same entry point. Numeric cells retain their already-computed `mode` and native `numberFormat`: a fractional share stays numeric and receives a percent format without multiplying or parsing its text. Plain `mode: "value"` cells may omit `numberFormat`; transformed modes still require it. Empty intersections need neither field; an explicit empty column format selects `General`. Row and column identities are opaque. `recordCount` counts physical projected rows, including summaries; `matched` still describes the underlying accepted records.
211
211
 
212
212
  XLSX places pivot summaries above their descendants and to their left, preserving captured outline levels, hidden descendants and collapsed summaries. It does not add `SUBTOTAL` formulas, a table or an autofilter over the pre-aggregated projection. Captured pivot outlines and totals reject conflicting worksheet overrides. Pivot exports also reject XLSX `cellValueWriters` and PDF `footer.totals`, preserving frozen values and aggregates. PDF and CSV include the complete projection, including initially hidden descendants; `PIVOT_OUTLINES_XLSX_ONLY` reports that the interactive outline controls belong to Excel. PDF retains resolved display text, headings and normal fit/band policies. A malformed explicit pivot rejects instead of silently becoming an ordinary flat export.
213
213
 
@@ -221,6 +221,8 @@ Datetime rule filters require `datetime: "typed"` and the UTC XLSX clock. Operan
221
221
 
222
222
  PDF defaults to landscape without shrinking the font. Flat and pivot captures measure the selected PDF font against a bounded lookahead of up to 128 rows or 262,144 displayed UTF-16 code units, then replay that single source. Column minimums protect the longest sampled header/content word; numeric and date columns reserve their natural value width. Remaining width first satisfies full header/content preferences, then goes to text columns. If the minimums exceed the printable width, horizontal bands retain readable widths. A word wider than a page can still break at scalar boundaries; later rows use the writer's ordinary lossless wrapping. Explicit `pdf.columnWidths`, horizontal-band settings and shaping providers retain their own layout policy.
223
223
 
224
+ The same flat/pivot PDF lookahead chooses one numeric convention for the entire document, including later streamed rows. A captured percentage's decimal comma or point takes precedence; otherwise the first numeric decimal mark is used, with a point when the sample has no signal. Grouping marks are distinguished from decimal marks using the frozen numeric value. Supported fixed number formats share that convention while retaining their declared precision and literal affixes. Unformatted whole values, including count aggregates, render as integers; an explicit `0.00` still requests two decimal places. Unformatted fractional values retain their captured precision. For example, with comma percentages a declared two-decimal amount is `1234,50`, an undeclared count is `3`, and an explicitly two-decimal count is `3,00`. CSV/XLSX keep their raw numeric values.
225
+
224
226
  Canopy PDF cells wrap independently of the grid's screen `wrap` setting. A seven-column grid with screen `wrap: false` still exports its full text, dates and numbers. An explicit `columnOptions[id].wrapText: false` retains strict nonwrapping behavior and rejects content that cannot fit; use suitable `pdf.columnWidths` or horizontal bands for that contract. Pivot summary and total rows are bold, and numeric columns default to right alignment. Raw numeric captures apply simple declared decimal/percentage/grouping formats to PDF text, retaining the sampled column's decimal separator and captured affixes. Complex native formats retain their resolved text. Missing values remain blank and computed zero values remain zero; neither is invented from the other. XLSX retains the captured screen wrapping unless overridden. Group headings, repeated column headings and continuation context use the existing grouped layout. Supply embedding-permitted TrueType fonts through `pdf.fonts` for Unicode, and a declared language through `pdf.tagged` for tagged reports. XLSX's native rule declarations do not render PDF bars or scales: PDF reports that loss and requires `unsupportedPresentation: "text"` to accept it. This option does not remove typed values, resolved text or valid links.
225
227
 
226
228
  Ordinary text-only grid/tree captures are accepted as flat output. Tree indentation does not create analytical groups. Relative links, history-series presentation and unmapped row/cell tones use the scalar/text projections above and report their presentation loss through synchronous `onDiagnostic` when supplied. Genuine unsupported presentation diagnostics and unsupported declarations still reject by default in XLSX/PDF. Explicit `unsupportedPresentation: "text"` accepts their text fallback and reports each diagnostic through the same callback. CSV defaults to text. Unsafe hyperlinks remain rejected. No unbounded diagnostic list or whole-table body is retained.
@@ -1211,7 +1213,19 @@ The archive exports `@evotecit/officeimo/classic.js`, `/xlsx.js`, `/csv.js`, `/p
1211
1213
  </script>
1212
1214
  ```
1213
1215
 
1214
- The combined bundle exposes all seven namespaces on global `OfficeIMO` plus the established root helpers. The XLSX bundle exposes `core`, `zip`, `xml`, `opc`, `xlsx`; CSV exposes `core`, `csv`; PDF exposes `core`, `pdf`. Load `officeimo-execution.js` beside the chosen writer to add `executeWorkerExport` and `handleWorkerExports` to `OfficeIMO`. The standalone bundles compose in either order. Classic scripts work from `file://` and in host-owned workers without a module loader. ES modules use normal import paths on HTTP(S) and in Node; browser local-file module policy can block `file://` imports.
1216
+ The combined bundle exposes all seven namespaces on global `OfficeIMO` plus the established root helpers. The XLSX bundle exposes `core`, `zip`, `xml`, `opc`, `xlsx`; CSV exposes `core`, `csv`; PDF exposes `core`, `pdf`. Load `officeimo-execution.js` beside the chosen writer to add `executeWorkerExport` and `handleWorkerExports` to `OfficeIMO`. The standalone bundles compose in either order.
1217
+
1218
+ The DataTables and CanopyX integrations also ship as thin adapters that take their document writers from the combined bundle instead of carrying their own copy. A page that uses both integrations, or also calls the writers directly, downloads the writers once:
1219
+
1220
+ ```html
1221
+ <script src="officeimo.min.js"></script>
1222
+ <script src="officeimo-datatables-adapter.min.js"></script>
1223
+ <script src="officeimo-canopyx-adapter.min.js"></script>
1224
+ ```
1225
+
1226
+ Load `officeimo.js` (or `officeimo.min.js`) from the same build before an adapter script; an adapter loaded alone throws an error that names the missing file. The `officeimo-*-adapter.mjs` modules import the sibling `officeimo.mjs` (and `.min.mjs` the sibling `officeimo.min.mjs`), so serve them from one folder. The single-file `officeimo-datatables.js` and `officeimo-canopyx.js` remain for pages that embed one integration only.
1227
+
1228
+ Every bundle also has a minified `.min.js`/`.min.mjs` variant. It has the same API. Classic `.min.js` scripts share module and class identities with the readable scripts of the same build, so the two can be mixed on one page. Each `.mjs` file is its own module graph: a `FormulaCell` or `PdfFont` from `officeimo.mjs` is not accepted by a writer from `officeimo.min.mjs`, so ES module consumers use one variant throughout. Keep the readable variant for debugging. The package exports the adapters as `@evotecit/officeimo/datatables-adapter.js` and `/canopyx-adapter.js`, and every bundle file under `@evotecit/officeimo/bundles/*`. Classic scripts work from `file://` and in host-owned workers without a module loader. ES modules use normal import paths on HTTP(S) and in Node; browser local-file module policy can block `file://` imports.
1215
1229
 
1216
1230
  [OfficeIMO.JavaScript.Assets](../OfficeIMO.JavaScript.Assets/README.md) embeds the same committed TypeScript-built bundles in .NET. Its `JavaScriptAsset` API returns exact content and content-hashed filenames; consuming .NET applications require no Node tooling. Standalone `.mjs` assemblies preserve the asset package's module API. The npm subpaths remain genuine separate `tsc` modules with generated declarations.
1217
1231
 
@@ -1226,6 +1240,6 @@ npm run test:browser -- /path/to/evidence/browser
1226
1240
  npm run sizes -- /path/to/evidence/sizes.json
1227
1241
  ```
1228
1242
 
1229
- `npm test` compiles strictly, checks committed bundles and runs Node's built-in runner. `npm run check` fails when a bundle differs from the compiled graph. No bundler or minifier is used. On Windows, `npm --script-shell pwsh` can select PowerShell 7 when the machine's default npm shell cannot resolve its tools.
1243
+ `npm test` compiles strictly, checks committed bundles and runs Node's built-in runner. `npm run check` fails when a bundle differs from the compiled graph. No bundler is used. `scripts/bundles.mjs` assembles each bundle and has esbuild, pinned to an exact version, minify that text into its `.min` variant; the check rebuilds those bytes too. On Windows, `npm --script-shell pwsh` can select PowerShell 7 when the machine's default npm shell cannot resolve its tools.
1230
1244
 
1231
1245
  The browser command uses the repository's existing isolated HtmlTinkerX/Playwright runner and pinned .NET SDK. It checks Chromium, Firefox and WebKit, classic `file://` scripts, ESM imports, workers, downloads and the shared corpus. [C# conformance tests](../OfficeIMO.JavaScript.Assets.Tests/JavaScriptConformanceTests.cs) independently open produced workbooks with OfficeIMO.Excel/OfficeIMO.Reader.Excel and validate them with the Open XML SDK. The [architecture guide](../Docs/officeimo.javascript-architecture.md) describes API stability, format ownership and adding a module.