@silurus/ooxml 0.1.0 → 0.2.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 +16 -0
- package/dist/docx-BigKt3jU.cjs +1 -0
- package/dist/docx-Dl67DX0B.js +721 -0
- package/dist/docx.cjs +1 -1
- package/dist/docx.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +3 -3
- package/dist/pptx-9gGaUMeA.js +1475 -0
- package/dist/pptx-E7x-tlbY.cjs +1 -0
- package/dist/pptx.cjs +1 -1
- package/dist/pptx.mjs +1 -1
- package/dist/types/index.d.ts +21 -1
- package/dist/types/pptx.d.ts +20 -1
- package/dist/xlsx-7RZtVIqa.js +1068 -0
- package/dist/xlsx-BJpXJcKz.cjs +4 -0
- package/dist/xlsx.cjs +1 -1
- package/dist/xlsx.mjs +1 -1
- package/package.json +1 -1
- package/dist/docx-Bpx5ZIHv.js +0 -721
- package/dist/docx-CVRWUA32.cjs +0 -1
- package/dist/pptx-D3vSvVQ6.js +0 -1475
- package/dist/pptx-DrZBtOP1.cjs +0 -1
- package/dist/xlsx-B-yZ85zA.js +0 -1068
- package/dist/xlsx-BhLRc4om.cjs +0 -4
package/README.md
CHANGED
|
@@ -2,10 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
# office-open-xml-viewer
|
|
4
4
|
|
|
5
|
+
[](https://www.npmjs.com/package/@silurus/ooxml)
|
|
6
|
+
[](https://www.npmjs.com/package/@silurus/ooxml)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
|
|
5
9
|
**[Demo (Storybook)](https://yukiyokotani.github.io/office-open-xml-viewer/)**
|
|
6
10
|
|
|
7
11
|
A browser-based viewer for Office Open XML documents that renders to an HTML Canvas element.
|
|
8
12
|
The parsers are written in Rust and compiled to WebAssembly; the renderers use the Canvas 2D API.
|
|
13
|
+
Each format also exposes a headless engine (`PptxPresentation` / `DocxDocument` / `XlsxWorkbook`) that renders into any caller-supplied canvas, so you can compose your own UI — scroll views, thumbnail grids, master-detail panes — instead of being locked into the built-in viewer. See the `Examples` section in [the Storybook demo](https://yukiyokotani.github.io/office-open-xml-viewer/).
|
|
14
|
+
|
|
15
|
+
| PPTX | DOCX | XLSX |
|
|
16
|
+
|:---:|:---:|:---:|
|
|
17
|
+
|  |  |  |
|
|
9
18
|
|
|
10
19
|
```bash
|
|
11
20
|
npm install @silurus/ooxml
|
|
@@ -494,6 +503,13 @@ cd packages/xlsx/parser && wasm-pack build --target web && cp pkg/xlsx_parser_bg
|
|
|
494
503
|
cd packages/docx/parser && wasm-pack build --target web && cp pkg/docx_parser_bg.wasm pkg/docx_parser.js ../src/wasm/
|
|
495
504
|
```
|
|
496
505
|
|
|
506
|
+
## Security & Privacy
|
|
507
|
+
|
|
508
|
+
- **Canvas-only rendering.** Documents are decoded and drawn to an `HTMLCanvasElement`. No script, link, form, or other active content from the source file is executed or injected into the DOM.
|
|
509
|
+
- **ZIP decompression cap.** Each entry in the source archive is limited to 512 MiB of uncompressed output to block zip-bomb DoS.
|
|
510
|
+
- **No network by default.** The library does not send telemetry or analytics, and does not contact third-party services unless you ask it to. In particular, PPTX theme webfonts are **not** loaded from Google Fonts unless you pass `useGoogleFonts: true` to `PptxPresentation.load()` / `new PptxViewer(...)`. Enabling that option causes the end-user's browser to send an HTTP request (IP and User-Agent) to `fonts.googleapis.com`, which may have GDPR implications for your application — consider self-hosting the required fonts via `@font-face` instead.
|
|
511
|
+
- **XML parsing.** Uses `roxmltree`, which does not resolve external entities (XXE-safe by default).
|
|
512
|
+
|
|
497
513
|
## License
|
|
498
514
|
|
|
499
515
|
MIT
|