@silurus/ooxml 0.57.0 → 0.58.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 CHANGED
@@ -30,7 +30,7 @@ pnpm add @silurus/ooxml
30
30
 
31
31
  > **Bundler note**: this package embeds `.wasm` files. With Vite add [`vite-plugin-wasm`](https://github.com/Menci/vite-plugin-wasm); with webpack use [`experiments.asyncWebAssembly`](https://webpack.js.org/configuration/experiments/).
32
32
 
33
- > **Bundle size note**: the package is ESM-only (`.mjs`). npm's *Unpacked Size* sums all four entry bundles, including the **opt-in** math engine (MathJax + STIX Two Math, ~3 MB). What actually lands in your app is much smaller — import only the format you need (e.g. `@silurus/ooxml/pptx`). The math engine is a **separate entry** (`@silurus/ooxml/math`): it is bundled **only if you import it and pass it to a viewer** (see [Rendering equations](#rendering-equations)). Viewers that never receive a `math` engine tree-shake the ~3 MB away entirely.
33
+ > **Bundle size note**: the package is ESM-only (`.mjs`). npm's *Unpacked Size* sums all four entry bundles, including the **opt-in** math engine (MathJax + STIX Two Math, ~4 MB). What actually lands in your app is much smaller — import only the format you need (e.g. `@silurus/ooxml/pptx`). The math engine is a **separate entry** (`@silurus/ooxml/math`): it is bundled **only if you import it and pass it to a viewer** (see [Rendering equations](#rendering-equations)). Viewers that never receive a `math` engine tree-shake the ~4 MB away entirely.
34
34
 
35
35
  ---
36
36
 
@@ -63,9 +63,9 @@ pptx.nextSlide();
63
63
 
64
64
  OMML equations (`m:oMath` / `m:oMathPara`) in `.docx`, `.pptx` and `.xlsx` are rendered with
65
65
  [MathJax](https://www.mathjax.org/) + [STIX Two Math](https://github.com/stipub/stixfonts).
66
- That engine is ~3 MB, so it is **opt-in**: import the `math` engine from the separate
66
+ That engine is ~4 MB, so it is **opt-in**: import the `math` engine from the separate
67
67
  `@silurus/ooxml/math` entry and pass it to the viewer. Pass it and equations render;
68
- omit it and the engine is referenced nowhere, so a bundler **tree-shakes the ~3 MB
68
+ omit it and the engine is referenced nowhere, so a bundler **tree-shakes the ~4 MB
69
69
  away entirely** (equations are simply skipped). It is fully self-contained: no
70
70
  network, no cross-origin requests.
71
71
 
@@ -420,9 +420,11 @@ export const PptxViewerComponent = component$<{ src: string }>(({ src }) => {
420
420
  | | Images (inline and anchored, with text wrap) | ✅ |
421
421
  | | Text boxes / drawing shapes | ✅ |
422
422
  | | WMF / EMF metafile images (legacy vector) | ❌ Not planned |
423
- | **Advanced** | Footnote / endnote reference markers | ✅ |
423
+ | **Advanced** | Footnotes reference markers + bottom-of-page bodies with separator rule, numbered (`w:footnoteReference` / `w:footnoteRef`, §17.11) | ✅ |
424
+ | | Endnotes — reference markers + bodies at document end (`w:endnoteReference`, §17.11) | ✅ |
425
+ | | `w:snapToGrid` opt-out of the document grid (§17.3.1.32) | ✅ |
424
426
  | | Track changes (`w:ins` / `w:del` — author-coloured underline / strikethrough) | ✅ |
425
- | | Comments / footnote bodies (parsed, not yet rendered inline) | ⚠️ |
427
+ | | Comments — author / date / text via the document model (`doc.comments`, §17.13.4; not drawn on the page) | |
426
428
  | | Mail merge fields | ❌ Not planned |
427
429
  | **Interaction** | Text selection (transparent overlay, native copy) | ✅ |
428
430
 
@@ -456,7 +458,7 @@ export const PptxViewerComponent = component$<{ src: string }>(({ src }) => {
456
458
  | **Elements** | Images (`<xdr:twoCellAnchor>`) | ✅ |
457
459
  | | Drawing shapes / text boxes (`xdr:sp`, `xdr:txBody` — 186 preset geometries via the shared engine, with `avLst` adjust handles) | ✅ |
458
460
  | | Math equations in shapes (OMML `m:oMath` / `m:oMathPara` in `xdr:txBody`, incl. `a14:m` / `mc:AlternateContent`; rendered via MathJax — opt-in `@silurus/ooxml/math`) | ✅ |
459
- | | Charts (bar, line, area, radar, scatter / bubble) | ✅ |
461
+ | | Charts (bar, line, area, pie, doughnut, radar, scatter / bubble) | ✅ |
460
462
  | | Chart markers (circle / square / diamond / triangle / x / plus / star / dot / dash, per-point `<c:dPt>` overrides) | ✅ |
461
463
  | | Chart data labels (`<c:dLbl>` per-point with CELLRANGE / VALUE / SERIESNAME / CATEGORYNAME field references, position `l`/`r`/`t`/`b`/`ctr`/`outEnd`) | ✅ |
462
464
  | | Chart error bars (`<c:errBars>` X/Y direction, `cust` / `fixedVal` / `stdErr` / `stdDev` / `percentage`, dashed/styled lines) | ✅ |
@@ -465,7 +467,8 @@ export const PptxViewerComponent = component$<{ src: string }>(({ src }) => {
465
467
  | **Advanced** | Conditional formatting (`cellIs`, `colorScale`, `dataBar`, `iconSet`, `top10`, `aboveAverage`) | ✅ |
466
468
  | | Slicers (static, Office 2010 extension) | ✅ |
467
469
  | | Pivot tables | ❌ Not planned |
468
- | | Data validation / comments | Not planned |
470
+ | | Cell comments / notes (classic `xl/commentsN.xml` + Office-365 threaded comments red triangle indicator + author / text via the worksheet model, shown in an Excel-style hover popup) | ✅ |
471
+ | | Data validation (rules via the worksheet model; `list`-type dropdown arrow on the selected cell whose click opens a panel showing the allowed values — read-only) | ✅ |
469
472
  | **Interaction** | Cell selection (single / range / row / column / all) | ✅ |
470
473
  | | Excel-style row / column header highlight on selection | ✅ |
471
474
  | | Shift+click to extend, Ctrl+C to copy as TSV | ✅ |
@@ -484,7 +487,7 @@ export const PptxViewerComponent = component$<{ src: string }>(({ src }) => {
484
487
  | | Slide size (custom dimensions) | ✅ |
485
488
  | | Slide background (solid, gradient, image) | ✅ |
486
489
  | | Slide numbers | ✅ |
487
- | | Notes pages | |
490
+ | | Speaker notes (plain text via `getNotes()`) | |
488
491
  | | Animations / transitions | ❌ Not planned |
489
492
  | **Element types** | Shapes (`sp`) | ✅ |
490
493
  | | Pictures (`pic`) | ✅ |
@@ -495,14 +498,13 @@ export const PptxViewerComponent = component$<{ src: string }>(({ src }) => {
495
498
  | | Charts (pie, doughnut) | ✅ |
496
499
  | | Charts (scatter — `scatterStyle` marker / line / smooth variants) | ✅ |
497
500
  | | Charts (bubble — `bubbleSize` per-point area scaling) | ✅ |
498
- | | SmartArt | |
499
- | | OLE objects | ❌ |
501
+ | | SmartArt (renders the PowerPoint-saved drawing layout `dsp:drawing`; no native diagram layout engine) | |
502
+ | | OLE embedded objects (`p:oleObj` — preview/icon rendering) | ❌ Not planned |
500
503
  | | Video / audio (poster + interactive playback) | ✅ |
501
504
  | | Ink / handwriting (`p:contentPart`, raster fallback) | ✅ |
502
- | **Shape geometry** | 130+ preset shapes (`prstGeom`) | ✅ |
505
+ | **Shape geometry** | 186 preset shapes (`prstGeom` — incl. 3D presets cube / can / bevel / frame) | ✅ |
503
506
  | | Custom geometry (`custGeom`) on shapes and pictures (clipping) | ✅ |
504
507
  | | Rotation and flip (flipH / flipV) | ✅ |
505
- | | 3D preset shapes | ❌ |
506
508
  | **Fills** | Solid fill (`solidFill`) | ✅ |
507
509
  | | Linear / radial gradient (`gradFill`) | ✅ |
508
510
  | | No fill (`noFill`) | ✅ |
@@ -518,9 +520,10 @@ export const PptxViewerComponent = component$<{ src: string }>(({ src }) => {
518
520
  | | Inner shadow (`innerShdw`) | ✅ |
519
521
  | | Soft edge (`softEdge`) | ✅ |
520
522
  | | Reflection (`reflection`) | ✅ |
521
- | | 3D camera / perspective projection (`scene3d` camera + `rot`) on pictures | ✅ |
522
- | | 3D contour edge (`sp3d` `contourW` / `contourClr`) on pictures — flat approximation, no bevel shading | ⚠️ |
523
- | | Bevel / 3D extrusion (`sp3d` `bevelT` / `bevelB` / `extrusionH`) | ⚠️ parsed; rendering planned |
523
+ | | 3D camera / perspective projection (`scene3d` camera + `rot`) on pictures and shapes — projected shape text is drawn but not selectable | ✅ |
524
+ | | 3D contour edge (`sp3d` `contourW` / `contourClr`) — flat approximation | ⚠️ |
525
+ | | Bevel shading (`sp3d` `bevelT` / `bevelB`) distance-field lip lit by `lightRig`, `matte`/`plastic` materials | ✅ |
526
+ | | 3D extrusion (`sp3d` `extrusionH` / `extrusionClr`) — swept side-wall approximation (visible only under a tilted camera) | ⚠️ |
524
527
  | **Text — characters** | Bold, italic, strikethrough (incl. `dblStrike`) | ✅ |
525
528
  | | Underline styles (`sng` / `dbl` / `dotted` / `dash` / `dashLong` / `dotDash` / `dotDotDash` / `wavy` / `wavyDbl` and `*Heavy` variants) | ✅ |
526
529
  | | Per-run underline colour (`uFill` / `uFillTx`) | ✅ |
@@ -569,7 +572,7 @@ export const PptxViewerComponent = component$<{ src: string }>(({ src }) => {
569
572
 
570
573
  - **[`packages/markdown/`](packages/markdown/)** — `@silurus/ooxml-markdown` and the `ooxml-md` CLI convert `.pptx` / `.docx` / `.xlsx` to GitHub-flavoured markdown via the workspace WASM parsers. Same projection used by the MCP server (~21× smaller than the raw XML on the demo deck, ~8% bigger than a flat-text extractor). Includes a node20-based GitHub Action for bulk repo-wide conversion.
571
574
  - **[`packages/node/`](packages/node/)** — Node-side parsers (`@silurus/ooxml-node`) exposing `parsePptx` / `parseDocx` / `parseXlsx` / `parseXlsxAllSheets` against the workspace WASM artifacts, with no DOM or Web Worker dependency. Useful for CI checks, headless rendering pipelines, and CLI tools. Includes an `ooxml-thumbnail` CLI (pptx-only first pass; requires `skia-canvas`).
572
- - **[`packages/vscode-extension/`](packages/vscode-extension/)** — VS Code extension (`ooxml-viewer`) that registers `CustomEditorProvider`s for `.docx`, `.xlsx`, and `.pptx`, and (opt-in) auto-installs and registers the `ooxml-mcp-server` so AI coding agents in the same window (Copilot Agent mode, Claude, …) can read those files via dedicated tools.
575
+ - **[`packages/vscode-extension/`](packages/vscode-extension/)** — VS Code extension (`ooxml-viewer`) that registers `CustomEditorProvider`s for `.docx`, `.xlsx`, and `.pptx`, and (opt-in) auto-installs and registers the `ooxml-mcp-server` so AI coding agents in the same window (Copilot Agent mode, Claude, …) can read those files via dedicated tools. The preview is offline by default; an opt-in `ooxmlViewer.useGoogleFonts` setting (off, and force-disabled in untrusted workspaces) surfaces the library's metric-compatible font substitution, widening the webview CSP to the Google Fonts CDN only while enabled.
573
576
  - **[`packages/mcp-server/`](packages/mcp-server/)** — Rust MCP server (`ooxml-mcp-server`) exposing the parsers as tools for AI agents (Claude, Copilot, Codex, etc.). Provides structured queries (`docx_get_structure`, `xlsx_get_cell_range`, `pptx_get_slide_structure`, …) so agents can inspect OOXML files without shelling out to `unzip`. Prebuilt binaries are attached to each [GitHub Release](https://github.com/yukiyokotani/office-open-xml-viewer/releases) for macOS / Linux / Windows; the VS Code extension downloads them on demand.
574
577
 
575
578
  ---