@silurus/ooxml 0.79.0 → 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.
- package/README.md +22 -15
- package/dist/assets/render-worker-BSx9_xRC.js +8 -0
- package/dist/assets/render-worker-BTp87EaD.js +21 -0
- package/dist/assets/render-worker-fdwAjSve.js +7 -0
- package/dist/{canvas-viewer-mechanics-D9tsuHnG.js → canvas-viewer-mechanics-D41tGY4d.js} +1 -1
- package/dist/{dash-Cyc-sevN.js → dash-CMzZIDz_.js} +87 -49
- package/dist/{document-pull-client-YiU8M4LO.js → document-pull-client-D-fnlVGf.js} +2247 -2254
- package/dist/{docx-a1UpmRf8.js → docx-CbIqgb1f.js} +108 -106
- package/dist/docx.mjs +4 -4
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/index.mjs +3 -3
- package/dist/line-distribute-DFdgzaLK.js +1002 -0
- package/dist/{line-metrics-DjKxiIUD.js → line-metrics-PpgpOvz4.js} +2774 -2524
- package/dist/math.mjs +34 -24
- package/dist/node.mjs +186 -186
- package/dist/{pptx-t5ABdzfd.js → pptx-DwF8olh2.js} +129 -127
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/region-map.mjs +75 -74
- package/dist/{render-BjIEuFIG.js → render-BMC4d1CO.js} +1 -1
- package/dist/render-worker-host-CcENRoDr.js +9 -0
- package/dist/render-worker-host-CzsHtsN_.js +9 -0
- package/dist/render-worker-host-DFgTN7hy.js +9 -0
- package/dist/renderer-module-contract-BNGz8HvO.js +30 -0
- package/dist/{resource-measurement-D8EiTm_E.js → resource-measurement-DvIKHd-9.js} +7 -7
- package/dist/{session-Bhe_eY-s.js → session-BzhcJOvj.js} +9 -9
- package/dist/{slide-pull-client-BQ8gJPTq.js → slide-pull-client-DLC3nJUt.js} +847 -861
- package/dist/three-d.mjs +828 -559
- package/dist/types/docx.d.ts +74 -8
- package/dist/types/index.d.ts +82 -12
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +70 -2
- package/dist/types/pptx.d.ts +74 -8
- package/dist/types/region-map.d.ts +68 -2
- package/dist/types/three-d.d.ts +68 -2
- package/dist/types/xlsx.d.ts +78 -8
- package/dist/{worksheet-pull-client-T0EzdEEQ.js → worksheet-pull-client-DlVk_4Bt.js} +13 -13
- package/dist/{xlsx-CsDDMJIK.js → xlsx-C1BUns1R.js} +1387 -1252
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +4 -1
- package/dist/line-distribute-pDqovJpT.js +0 -1002
- package/dist/render-worker-host-BB320snY.js +0 -27
- package/dist/render-worker-host-BjEPZBwf.js +0 -27
- package/dist/render-worker-host-hZ0o4OD7.js +0 -27
- /package/dist/{highlight-rect-cCvVU-MW.js → highlight-rect-BuX5rWP4.js} +0 -0
- /package/dist/{mathjax-Dqo857oC.js → mathjax-DgAl7Yi5.js} +0 -0
- /package/dist/{transfer-3QEJrsJa.js → transfer-CKZ79zFw.js} +0 -0
- /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` |
|
|
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
|
|
109
|
-
>
|
|
110
|
-
>
|
|
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
|
|
186
|
-
|
|
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
|
|
213
|
-
|
|
214
|
-
|
|
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: '
|
|
228
|
+
mode: 'worker',
|
|
228
229
|
});
|
|
229
230
|
await workbookViewer.load('/workbook-with-advanced-charts.xlsx');
|
|
230
231
|
```
|
|
231
232
|
|
|
232
|
-
The Region Map
|
|
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
|
|
244
|
-
Worker — the main thread
|
|
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
|
-
-
|
|
275
|
-
|
|
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.
|