@silurus/ooxml 0.79.1 → 0.80.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.
Files changed (45) hide show
  1. package/README.md +22 -15
  2. package/dist/assets/render-worker-BSx9_xRC.js +8 -0
  3. package/dist/assets/render-worker-BTp87EaD.js +21 -0
  4. package/dist/assets/render-worker-fdwAjSve.js +7 -0
  5. package/dist/{canvas-viewer-mechanics-DJ9yfiLN.js → canvas-viewer-mechanics-D41tGY4d.js} +1 -1
  6. package/dist/{document-pull-client-DYoybVCn.js → document-pull-client-D-fnlVGf.js} +2246 -2253
  7. package/dist/{docx-CSk_-kj_.js → docx-CbIqgb1f.js} +107 -105
  8. package/dist/docx.mjs +4 -4
  9. package/dist/index.mjs +3 -3
  10. package/dist/line-distribute-DFdgzaLK.js +1002 -0
  11. package/dist/{line-metrics-A77J_KRx.js → line-metrics-PpgpOvz4.js} +1813 -1680
  12. package/dist/math.mjs +34 -24
  13. package/dist/node.mjs +186 -186
  14. package/dist/{pptx-CO1Ut97p.js → pptx-DwF8olh2.js} +128 -126
  15. package/dist/pptx.mjs +5 -5
  16. package/dist/region-map.mjs +75 -74
  17. package/dist/{render-C5m7Ddwx.js → render-BMC4d1CO.js} +1 -1
  18. package/dist/render-worker-host-CcENRoDr.js +9 -0
  19. package/dist/render-worker-host-CzsHtsN_.js +9 -0
  20. package/dist/render-worker-host-DFgTN7hy.js +9 -0
  21. package/dist/renderer-module-contract-BNGz8HvO.js +30 -0
  22. package/dist/{resource-measurement-COxqtfGk.js → resource-measurement-DvIKHd-9.js} +7 -7
  23. package/dist/{session-CJwZaquG.js → session-BzhcJOvj.js} +9 -9
  24. package/dist/{slide-pull-client-CFHNk0ek.js → slide-pull-client-DLC3nJUt.js} +847 -861
  25. package/dist/three-d.mjs +311 -310
  26. package/dist/types/docx.d.ts +7 -7
  27. package/dist/types/index.d.ts +9 -9
  28. package/dist/types/math.d.ts +1 -1
  29. package/dist/types/node.d.ts +2 -2
  30. package/dist/types/pptx.d.ts +7 -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 +7 -7
  34. package/dist/{worksheet-pull-client-CziyJf24.js → worksheet-pull-client-DlVk_4Bt.js} +13 -13
  35. package/dist/{xlsx-DHQmjAfh.js → xlsx-C1BUns1R.js} +1206 -1216
  36. package/dist/xlsx.mjs +5 -5
  37. package/package.json +4 -1
  38. package/dist/line-distribute-CU7vu7XS.js +0 -1002
  39. package/dist/render-worker-host-BhMT5U73.js +0 -27
  40. package/dist/render-worker-host-DNMxGh5s.js +0 -27
  41. package/dist/render-worker-host-DWyg7wio.js +0 -27
  42. /package/dist/{highlight-rect-cCvVU-MW.js → highlight-rect-BuX5rWP4.js} +0 -0
  43. /package/dist/{mathjax-Dqo857oC.js → mathjax-DgAl7Yi5.js} +0 -0
  44. /package/dist/{transfer-3QEJrsJa.js → transfer-CKZ79zFw.js} +0 -0
  45. /package/dist/{visible-index-CKvgpUrf.js → visible-index-BjesVGhg.js} +0 -0
package/README.md CHANGED
@@ -89,7 +89,7 @@ pnpm add @silurus/ooxml
89
89
  > | `@silurus/ooxml/xlsx` | 2.6 MB | 0.82 MB | XLSX renderer, parser WASM, and lazy worker |
90
90
  > | `@silurus/ooxml/pptx` | 2.5 MB | 0.78 MB | PPTX renderer, parser WASM, and lazy worker |
91
91
  > | `@silurus/ooxml/math` | 3.1 MB | 1.1 MB | Optional MathJax + STIX Two Math engine |
92
- > | `@silurus/ooxml/three-d` | 81 KB | 23 KB | Optional model-space 3-D chart mesh and camera |
92
+ > | `@silurus/ooxml/three-d` | 92 KB | 27 KB | Optional model-space 3-D chart mesh and camera |
93
93
  > | `@silurus/ooxml/region-map` | 236 KB | 66 KB | Optional offline Region Map renderer and fixed country geometry |
94
94
  >
95
95
  > These are production-artifact estimates, not initial-load figures: each row
@@ -105,9 +105,10 @@ pnpm add @silurus/ooxml
105
105
  > and the loader chunk never enters your graph at all.
106
106
  >
107
107
  > The 3-D chart and Region Map renderers follow the same dependency-injection
108
- > boundary: import and pass only the addons an application needs. Ordinary
109
- > format entries do not reach either optional implementation, so bundlers can
110
- > tree-shake their mesh code and fixed geographic asset completely.
108
+ > boundary: import and pass only the optional renderer modules an application
109
+ > needs. Their implementations are not eagerly loaded or evaluated in main
110
+ > mode. Worker mode fetches a self-contained render-worker asset that includes
111
+ > the worker-side built-ins, so consumer bundlers can copy it safely.
111
112
 
112
113
  ---
113
114
 
@@ -182,8 +183,8 @@ OMML equations (`m:oMath` / `m:oMathPara`) in `.docx`, `.pptx` and `.xlsx` are r
182
183
  [MathJax](https://www.mathjax.org/) + [STIX Two Math](https://github.com/stipub/stixfonts).
183
184
  That engine is ~3 MB, so it is **opt-in**: import the `math` engine from the separate
184
185
  `@silurus/ooxml/math` entry and pass it to the viewer. Pass it and equations render;
185
- omit it and the engine is referenced nowhere, so a bundler leaves it out of your build
186
- entirely (equations are simply skipped). When you *do* pass it, the ~3 MB engine ships
186
+ omit it and the engine asset is not fetched or evaluated (equations are simply skipped;
187
+ the on-demand render-worker asset retains a small loader). When you *do* pass it, the ~3 MB engine ships
187
188
  as a **standalone asset file** next to the bundle rather than an inline data URL, and is
188
189
  fetched **on demand — only the first time a document actually contains an equation**, so
189
190
  equation-free documents never pay for it. It is fully self-contained: served from your own
@@ -209,9 +210,9 @@ shapes / text boxes the same way.)
209
210
  ### Optional chart renderers
210
211
 
211
212
  Model-space 3-D charts and offline country-level Region Maps are separate
212
- entries. Inject them once in the same load options object as `math`; omitting an
213
- addon keeps it out of the application graph. They currently render on the main
214
- thread, so use `mode: 'main'` (the default). Without `threeD`, 3-D chart groups
213
+ entries. Inject them once in the same load options object as `math`; omitting a
214
+ renderer keeps it out of the ordinary render path. The built-in renderers work
215
+ in both main and worker modes. Without `threeD`, 3-D chart groups
215
216
  fall back to their canonical 2-D family. Without `regionMap`, Region Maps show
216
217
  the standard unsupported-chart placeholder.
217
218
 
@@ -224,12 +225,12 @@ const container = document.getElementById('xlsx-container') as HTMLElement;
224
225
  const workbookViewer = new XlsxViewer(container, {
225
226
  threeD,
226
227
  regionMap,
227
- mode: 'main',
228
+ mode: 'worker',
228
229
  });
229
230
  await workbookViewer.load('/workbook-with-advanced-charts.xlsx');
230
231
  ```
231
232
 
232
- The Region Map addon is deterministic and network-free. It uses a pinned
233
+ The Region Map renderer is deterministic and network-free. It uses a pinned
233
234
  Natural Earth country dataset, supports authored world projections and
234
235
  two/three-stop value ramps, and fails closed for cached identities or
235
236
  sub-country/view-specific layouts that the bounded offline model cannot yet
@@ -240,8 +241,8 @@ chart behavior is documented in
240
241
  ### Off-main-thread rendering
241
242
 
242
243
  By default the headless engines parse in a worker but render on the main thread.
243
- Pass `mode: 'worker'` to `.load()` to parse **and** render entirely inside a Web
244
- Worker — the main thread only paints the returned `ImageBitmap` via a
244
+ Pass `mode: 'worker'` to `.load()` to normally parse **and** render inside a Web
245
+ Worker — the main thread presents the returned `ImageBitmap` via a
245
246
  `bitmaprenderer` context, keeping it free for scrolling and input. It requires
246
247
  `Worker` + `OffscreenCanvas`.
247
248
 
@@ -271,8 +272,14 @@ Notes:
271
272
  - The canvas-target methods (`renderSlide(canvas)`, `renderPage(canvas)`,
272
273
  `renderViewport(canvas)`) are unavailable in worker mode — use the `*ToBitmap`
273
274
  variants instead.
274
- - OMML equations require `mode: 'main'`; in worker mode they are skipped (with a
275
- console warning).
275
+ - The built-in math, 3-D chart, and Region Map renderers work in both modes
276
+ through the same `math`, `threeD`, and `regionMap` options. Custom renderer
277
+ objects are main-realm code and therefore use the feature's documented
278
+ fallback in `mode: 'worker'`.
279
+ - A DOCX document that requires browser-only OpenType vertical-glyph selection
280
+ automatically uses effective main mode for correct shaping. Read
281
+ `document.mode` after loading when your integration needs to observe this
282
+ fallback.
276
283
  - Trade-off: worker mode keeps the main thread responsive, but each frame is
277
284
  transferred back as an `ImageBitmap`, so a single render can be marginally
278
285
  slower than `mode: 'main'`. Choose it for non-blocking UI, not raw speed.