@silurus/ooxml 0.85.1 → 0.85.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.
Files changed (40) hide show
  1. package/README.md +3 -2
  2. package/dist/assets/render-worker-CV9Mg4j9.js +10 -0
  3. package/dist/assets/{render-worker-BRKOyWVH.js → render-worker-DHP0rgcW.js} +16 -16
  4. package/dist/assets/render-worker-DdvOGyrn.js +11 -0
  5. package/dist/{canvas-viewer-mechanics-CfRzOhz5.js → canvas-viewer-mechanics-CDNMJ-Yz.js} +1 -1
  6. package/dist/{document-pull-client-BkHHIdR4.js → document-pull-client-BssAk95w.js} +3875 -3865
  7. package/dist/{docx-_uelcAui.js → docx-BY7oyoml.js} +17 -37
  8. package/dist/docx.mjs +5 -5
  9. package/dist/{dom-interaction-boundary-CMDDgICk.js → dom-interaction-boundary-CDGegIB5.js} +1 -1
  10. package/dist/index.mjs +3 -3
  11. package/dist/line-distribute-BsV4MVZ2.js +1023 -0
  12. package/dist/{line-metrics-u87yCAfV.js → line-metrics-BGtFM-ec.js} +650 -607
  13. package/dist/node.mjs +30 -30
  14. package/dist/{pptx-WpBbS0mq.js → pptx-C4z96sAA.js} +23 -23
  15. package/dist/pptx.mjs +6 -6
  16. package/dist/pptx_parser_bg.wasm +0 -0
  17. package/dist/{raster-target-whZhvVMt.js → raster-target-ojDdQizC.js} +11 -7
  18. package/dist/{render-DrAAZWwH.js → render-Dxvwes39.js} +1 -1
  19. package/dist/{render-worker-host-CBVe8aeD.js → render-worker-host-BAXcBGq3.js} +1 -1
  20. package/dist/{render-worker-host-CHlwYJdK.js → render-worker-host-CNKQ76tu.js} +1 -1
  21. package/dist/{render-worker-host-XDMsyVsv.js → render-worker-host-CXTCU4PO.js} +1 -1
  22. package/dist/{resource-measurement-6uR3Huao.js → resource-measurement-D41R-0Bl.js} +4 -4
  23. package/dist/{session-DoPwA4gv.js → session-BmP4lcEo.js} +6 -6
  24. package/dist/{slide-pull-client-8i8C4VyD.js → slide-pull-client-RTwQbJiy.js} +707 -697
  25. package/dist/tiff.mjs +1 -1
  26. package/dist/types/chart-ex.d.ts +2 -2
  27. package/dist/types/docx.d.ts +8 -10
  28. package/dist/types/index.d.ts +12 -14
  29. package/dist/types/node.d.ts +5 -5
  30. package/dist/types/pptx.d.ts +8 -7
  31. package/dist/types/region-map.d.ts +2 -2
  32. package/dist/types/three-d.d.ts +2 -2
  33. package/dist/types/xlsx.d.ts +8 -7
  34. package/dist/{worksheet-pull-client-Btydoxto.js → worksheet-pull-client-C9sC36Vu.js} +20 -20
  35. package/dist/{xlsx-Bd16V4Xx.js → xlsx-DSU6pV1O.js} +1214 -1208
  36. package/dist/xlsx.mjs +6 -6
  37. package/package.json +1 -1
  38. package/dist/assets/render-worker-CtLMFj9r.js +0 -10
  39. package/dist/assets/render-worker-NZPOUOTU.js +0 -11
  40. package/dist/line-distribute-CiKeWjBF.js +0 -1023
package/README.md CHANGED
@@ -1052,16 +1052,17 @@ try {
1052
1052
 
1053
1053
  The report is content-free by construction: it does not include source URLs, filenames, package paths, document text, passwords, or raw error messages. It still contains document-derived sizes, counts, and timings, so applications remain responsible for consent, retention, and telemetry policy. The initial browser callback covers the underlying document/workbook/presentation factory and does not wait for a Viewer's first canvas paint; use `getResourceMetrics()` for the latest observed package counters. Bounded Node sessions accept both `onResourceMetrics` and `debug`. DOCX/PPTX report successful terminal metrics when their one-pass stream completes or the session is explicitly closed; XLSX reports success when the reusable workbook session is explicitly closed. Open-time and session-operation failures report immediately.
1054
1054
 
1055
- Image decoding uses a separate adaptive resource policy shared by all three formats. Target-resizable rasters—browser-decodable formats and TIFF when its optional codec is configured—keep their native decode while the complete visible paint fits the default 128 MiB decoded budget and the per-surface ceilings, preserving established output. When native ownership would cross either boundary, the renderer decodes those rasters at the current canvas/DPR requirement instead of retaining source pixels the paint cannot show. If even those display targets exceed the aggregate budget, it applies one uniform quality reduction across them; a later zoom requests a sharper cache variant. Image-bearing paints for the same loaded document are serialized so overlapping paints cannot each consume the full budget, while the admitted paint still runs up to two decodes concurrently. Formats or sources that cannot be decoder-resized remain on their format-specific path under the hard surface ceilings. Applications with a known environment can override the aggregate budget on Viewer or per-render options:
1055
+ Image decoding uses a separate adaptive resource policy shared by all three formats. Ordinary browser-decodable rasters are assigned a geometry-weighted share of the default 128 MiB decoded budget before source extraction. Each source can then flow directly from extraction to decode: it keeps native resolution when it fits its share and otherwise uses up to a 2x canvas/DPR grid when that share has headroom, avoiding visibly soft 1x intermediates for small placed artwork. If the complete set of display grids itself exceeds the budget, adaptive mode reduces them by one uniform quality ratio. This avoids an all-paint inspection barrier without making display-sized downsampling the default. Natural-size consumers, pixel effects that require the authored grid, and formats that cannot be decoder-resized remain on their guarded format-specific paths under the hard surface ceilings. Image-bearing paints for the same loaded document are serialized so overlapping paints cannot each consume the full budget, while the admitted paint still runs up to two decodes concurrently. Applications with a known environment can override the aggregate budget on Viewer or per-render options:
1056
1056
  ```ts
1057
1057
  new PptxViewer(canvas, {
1058
1058
  imageResources: {
1059
1059
  decodedByteBudget: 256 * 1024 * 1024,
1060
1060
  strategy: 'adaptive', // or 'strict' to reject instead of reducing quality
1061
+ resolution: 'native-if-fit', // or 'display' to minimize retained pixels
1061
1062
  },
1062
1063
  });
1063
1064
  ```
1064
- `decodedByteBudget` accepts a positive safe integer from 4 bytes through 512 MiB. This configures planned and retained decoded RGBA ownership; it does not measure browser decoder intermediates or disable the encoded-source, per-axis, or per-surface hard safety ceilings. A strict aggregate crossing or any hard-ceiling crossing rejects with `OoxmlDecodedImageLimitError` (`code === 'ooxml-decoded-image-limit'`) instead of silently omitting the image.
1065
+ `resolution` defaults to `'native-if-fit'`. Use `'display'` when minimizing retained raster pixels is more important than preserving source-resolution sampling. `decodedByteBudget` accepts a positive safe integer from 4 bytes through 512 MiB. This configures planned and retained decoded RGBA ownership; it does not measure browser decoder intermediates or disable the encoded-source, per-axis, or per-surface hard safety ceilings. A strict aggregate crossing or any hard-ceiling crossing rejects with `OoxmlDecodedImageLimitError` (`code === 'ooxml-decoded-image-limit'`) instead of silently omitting the image.
1065
1066
 
1066
1067
  The package counters and raster-image guards are deterministic admission limits, not exact JavaScript/WASM process-memory accounting. XML trees, document models, canvas backing stores, browser decoder overhead, renderer state, and browser-managed SVG/vector parse or decoded storage can still require several times the measured input. SVG has no portable decoded-byte measure or explicit browser release primitive; the library count-bounds its cache and revokes owned object URLs, but cannot charge it as RGBA bytes. The defaults therefore reduce risk but cannot promise that an OOM is impossible on every device. Running parse and render work in `mode: 'worker'` can contain many failures away from the main UI thread, but a Worker is not a separate operating-system process or a strict memory sandbox.
1067
1068