@silurus/ooxml 0.16.0 → 0.17.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 +20 -9
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/pptx-CEHbFVsy.js +23854 -0
- package/dist/pptx-Cn6PQpHT.cjs +1 -0
- package/dist/pptx.cjs +1 -1
- package/dist/pptx.mjs +1 -1
- package/package.json +1 -1
- package/dist/pptx-Dvlu_0iN.js +0 -23854
- package/dist/pptx-mS90ORGU.cjs +0 -1
package/README.md
CHANGED
|
@@ -76,29 +76,38 @@ flowchart TB
|
|
|
76
76
|
end
|
|
77
77
|
|
|
78
78
|
subgraph browser["🌐 Runtime (Browser)"]
|
|
79
|
+
subgraph core_pkg["@silurus/ooxml-core (shared primitives)"]
|
|
80
|
+
CORE["renderChart · resolveFill · applyStroke\nbuildCustomPath · autoResize · shared types"]
|
|
81
|
+
end
|
|
79
82
|
subgraph docx_pkg["@silurus/ooxml · docx"]
|
|
80
83
|
DV["DocxViewer"] --> DD["DocxDocument"]
|
|
81
|
-
DD -->
|
|
84
|
+
DD --> DW["worker.ts\n〈Web Worker — parse only〉"]
|
|
85
|
+
DD --> DR["renderer.ts\n〈Canvas 2D — main thread〉"]
|
|
82
86
|
end
|
|
83
87
|
subgraph xlsx_pkg["@silurus/ooxml · xlsx"]
|
|
84
|
-
XV["XlsxViewer"] -->
|
|
88
|
+
XV["XlsxViewer"] --> XB["XlsxWorkbook"]
|
|
89
|
+
XB --> XW["worker.ts\n〈Web Worker — parse only〉"]
|
|
90
|
+
XB --> XR["renderer.ts\n〈Canvas 2D — main thread〉"]
|
|
85
91
|
end
|
|
86
92
|
subgraph pptx_pkg["@silurus/ooxml · pptx"]
|
|
87
93
|
PV["PptxViewer"] --> PP["PptxPresentation"]
|
|
88
94
|
PP --> PW["worker.ts\n〈Web Worker — parse only〉"]
|
|
89
95
|
PP --> PR["renderer.ts\n〈Canvas 2D — main thread〉"]
|
|
90
96
|
end
|
|
97
|
+
DR -. uses .-> CORE
|
|
98
|
+
XR -. uses .-> CORE
|
|
99
|
+
PR -. uses .-> CORE
|
|
91
100
|
end
|
|
92
101
|
|
|
93
|
-
docx_wasm -->
|
|
94
|
-
xlsx_wasm -->
|
|
102
|
+
docx_wasm --> DW
|
|
103
|
+
xlsx_wasm --> XW
|
|
95
104
|
pptx_wasm --> PW
|
|
96
105
|
DR --> canvas["<canvas>"]
|
|
97
106
|
XR --> canvas
|
|
98
107
|
PR --> canvas
|
|
99
108
|
```
|
|
100
109
|
|
|
101
|
-
|
|
110
|
+
All three formats follow the same shape: the worker parses the `.docx` / `.xlsx` / `.pptx` archive via WASM and posts a JSON model back to the main thread, where the renderer draws to the canvas. Rendering stays on the main thread so the canvas shares the document's `FontFaceSet` — an `OffscreenCanvas` in a worker has its own font registry and would silently fall back to a system font, producing subtly different text measurements (and wrap positions) from the installed theme webfonts. `@silurus/ooxml-core` holds the cross-format primitives that the three renderers all depend on: a unified chart renderer (bar / line / area / radar / waterfall), shape helpers (`resolveFill`, `applyStroke`, `buildCustomPath`, `hexToRgba`), the `autoResize` viewer utility, and the shared type definitions.
|
|
102
111
|
|
|
103
112
|
### Key files
|
|
104
113
|
|
|
@@ -107,11 +116,12 @@ The pptx worker parses the `.pptx` archive via WASM and returns a JSON model to
|
|
|
107
116
|
| `packages/docx/parser/src/lib.rs` | Rust WASM parser — DOCX ZIP → `Document` JSON |
|
|
108
117
|
| `packages/xlsx/parser/src/lib.rs` | Rust WASM parser — XLSX ZIP → `Workbook` JSON |
|
|
109
118
|
| `packages/pptx/parser/src/lib.rs` | Rust WASM parser — PPTX ZIP → `Presentation` JSON |
|
|
110
|
-
| `packages/docx/src/renderer.ts` | Canvas 2D rendering engine with text layout |
|
|
111
|
-
| `packages/xlsx/src/renderer.ts` | Canvas 2D rendering engine with virtual scroll |
|
|
112
|
-
| `packages/pptx/src/renderer.ts` | Canvas 2D rendering engine (
|
|
113
|
-
| `packages
|
|
119
|
+
| `packages/docx/src/renderer.ts` | Canvas 2D rendering engine with text layout (main thread) |
|
|
120
|
+
| `packages/xlsx/src/renderer.ts` | Canvas 2D rendering engine with virtual scroll (main thread) |
|
|
121
|
+
| `packages/pptx/src/renderer.ts` | Canvas 2D rendering engine (main thread) |
|
|
122
|
+
| `packages/*/src/worker.ts` | Web Worker: WASM init and parsing only (one per format) |
|
|
114
123
|
| `packages/*/src/viewer.ts` | Public Viewer API — canvas lifecycle, navigation |
|
|
124
|
+
| `packages/core/src/index.ts` | Cross-format primitives — chart renderer, shape helpers, `autoResize`, shared types |
|
|
115
125
|
|
|
116
126
|
</details>
|
|
117
127
|
|
|
@@ -447,6 +457,7 @@ export const PptxViewerComponent = component$<{ src: string }>(({ src }) => {
|
|
|
447
457
|
| | SmartArt | ❌ |
|
|
448
458
|
| | OLE objects | ❌ |
|
|
449
459
|
| | Video / audio (poster + interactive playback) | ✅ |
|
|
460
|
+
| | Ink / handwriting (`p:contentPart`, raster fallback) | ✅ |
|
|
450
461
|
| **Shape geometry** | 130+ preset shapes (`prstGeom`) | ✅ |
|
|
451
462
|
| | Custom geometry (`custGeom`) | ✅ |
|
|
452
463
|
| | Rotation and flip (flipH / flipV) | ✅ |
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./pptx-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./pptx-Cn6PQpHT.cjs`),t=require(`./xlsx-CWkWdRpm.cjs`),n=require(`./docx-DKPVLT6O.cjs`);Object.defineProperty(exports,`docx`,{enumerable:!0,get:function(){return n.t}}),Object.defineProperty(exports,`pptx`,{enumerable:!0,get:function(){return e.t}}),Object.defineProperty(exports,`xlsx`,{enumerable:!0,get:function(){return t.t}});
|
package/dist/index.mjs
CHANGED