@silurus/ooxml 0.54.0 → 0.56.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
@@ -61,7 +61,7 @@ pptx.nextSlide();
61
61
 
62
62
  ### Rendering equations
63
63
 
64
- OMML equations (`m:oMath` / `m:oMathPara`) in `.docx` / `.pptx` are rendered with
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
66
  That engine is ~3 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;
@@ -78,12 +78,13 @@ const docx = new DocxViewer(canvas, { math }); // ← equations now render
78
78
  await docx.load('/paper-with-equations.docx');
79
79
  ```
80
80
 
81
- The same `math` engine works for `PptxViewer`, `XlsxViewer`, and the headless
82
- `DocxDocument` / `PptxPresentation` APIs (which take `math` in their options).
83
- Excel stores "Insert > Equation" as OMML inside the shared DrawingML `<xdr:txBody>`
84
- grammar, so `XlsxViewer` renders equations embedded in shapes / text boxes the same
85
- way pass `math` and they render; omit it and those equations are skipped and the
86
- engine is tree-shaken away.
81
+ The same `math` engine works for every viewer (`DocxViewer`, `PptxViewer`,
82
+ `XlsxViewer`) and every headless engine (`DocxDocument`, `PptxPresentation`,
83
+ `XlsxWorkbook`). You inject it **once** where you create the object the viewer
84
+ constructor or the `.load()` options and every render reuses it; it is never a
85
+ per-render argument. (Excel stores "Insert > Equation" as OMML inside the shared
86
+ DrawingML `<xdr:txBody>` grammar, so `XlsxViewer` renders equations embedded in
87
+ shapes / text boxes the same way.)
87
88
 
88
89
  ---
89
90
 
@@ -410,7 +411,11 @@ export const PptxViewerComponent = component$<{ src: string }>(({ src }) => {
410
411
  | | Table style borders / shading / banding (`tblStylePr`, `cnfStyle`, §17.4.7) | ✅ |
411
412
  | | Table of contents (TOC field) — dot leaders, right-aligned page numbers | ✅ |
412
413
  | | keepNext / keepLines / widowControl | ✅ |
414
+ | | Right-to-left text — UAX#9 bidi, `w:bidi` / `w:rtl`, complex-script formatting (`w:szCs` / `w:bCs` / `rFonts@cs`, §17.3.2.26), RTL lists and indents | ✅ |
415
+ | | Japanese kinsoku line breaking (`w:kinsoku`, §17.15.1.58 — 行頭/行末禁則) | ✅ |
413
416
  | **Elements** | Tables (with borders, fills, merges, banding, alignment) | ✅ |
417
+ | | Table auto-layout by preferred widths (`w:tblLayout` autofit, §17.4.52; min content width) | ✅ |
418
+ | | Right-to-left table column order (`w:bidiVisual`, §17.4.1) | ✅ |
414
419
  | | Math equations (OMML `m:oMath` / `m:oMathPara`, rendered via MathJax — opt-in `@silurus/ooxml/math`) | ✅ |
415
420
  | | Images (inline and anchored, with text wrap) | ✅ |
416
421
  | | Text boxes / drawing shapes | ✅ |
@@ -444,6 +449,7 @@ export const PptxViewerComponent = component$<{ src: string }>(({ src }) => {
444
449
  | | Text wrapping | ✅ |
445
450
  | | Number formats (`0.00`, `%`, `#,##0`, custom date/time) | ✅ |
446
451
  | **Structure** | Merged cells | ✅ |
452
+ | | Right-to-left sheets (`sheetView rightToLeft`, §18.3.1.87 — mirrored grid, headers, selection, scroll) | ✅ |
447
453
  | | Frozen panes | ✅ |
448
454
  | | Row / column sizing (custom widths and heights) | ✅ |
449
455
  | | Hidden rows / columns | ✅ |
@@ -532,7 +538,7 @@ export const PptxViewerComponent = component$<{ src: string }>(({ src }) => {
532
538
  | | Tab stops | ✅ |
533
539
  | | Indent / margin | ✅ |
534
540
  | | Vertical text (`bodyPr@vert` — vert / vert270 / eaVert) | ✅ |
535
- | | Right-to-left paragraph (`pPr@rtl` Arabic / Hebrew default alignment + browser bidi) | ✅ |
541
+ | | Right-to-left text — UAX#9 bidi engine, `pPr@rtl`, RTL bullets, `bodyPr@rtlCol` column order, `tblPr@rtl` tables | ✅ |
536
542
  | **Text — body** | Text padding (insets) | ✅ |
537
543
  | | normAutoFit (shrink to fit) | ✅ |
538
544
  | | spAutoFit (expand box; suppresses wrap when text fits in one line) | ✅ |